Reputation: 645
I need to make a some parts inside an contenteditable iframe as non-editable. How do I do that? The below code works in chrome but not in firefox. Everything is editable in firefox. Ineed the checkbox to be noneditable
<iframe contentEditable="true" >
Editable text<div contentEditable="false"><input type="checkbox" /></div>
</iframe>
Upvotes: 4
Views: 9193
Reputation: 21
I found a solution with an input text with an attribut readonly. I found the width of the input with a span invisible and I got the width of the span outside of my contenteditable.
Works like a cham !
Upvotes: 0
Reputation: 6000
Use this:
Editable text<div contentEditable="false" readonly>Non content editable text</div>
If you want to use JQuery:
$('#divId').attr('readonly', 'true');
Upvotes: 9