Reputation: 617
$mydiv's child elements are editable. I want to save html into db and expect small html. The following property removal not work.
How to make it work?
let big_html = $mydiv.html();
$mydiv.children().each(function () {
$(this).removeProp('contenteditable'); // Not work!
});
let small_html = $mydiv.html();
Upvotes: 2
Views: 373
Reputation: 7997
contenteditable is a global attribute not a property
you can manipulate it
$(this).attr('contenteditable',true) // or false
or remove it:
$(this).removeAttr('contenteditable')
Upvotes: 3