I have an ifram on a page with class ms-dlgFrame and in this iframe I want to remove contenteditable="true" on elements since it's not supported by Safari on iPad (I am checking the user agent first).
I have some issues with combining .find(), .each(), .attr()
, and .removeAttr()
I tried something like:
console.log("iPad");
$('.ms-dlgFrame').contents().find("div").attr("contenteditable").each(function() {
$(this).removeAttr("contenteditable");
});
Any ideas?
Thanks in advance.
Try the selector div[contenteditable='true']
and drop the attr()
call from your chain:
console.log("iPad");
$('.ms-dlgFrame').contents().find("div[contenteditable='true']").each(function() {
$(this).removeAttr("contenteditable");
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With