I have a span with contenteditable tag and I have a function used to detect input into it..
//TextArea
<span class="SomeClass" contenteditable></span>
//Function
$(document).on("input", ".SomeClass", function () {
console.log("input entered");
});
This works for me on Chrome but not on the IE 11 or below. I can't seem to find any mention of it online and was wondering if anyone could give me information on how to get this working or a better approach.
Thanks
This is a reported bug (#794285) in IE10 and IE11: contenteditable
elements do not fire the input
event.
A workaround be to handle different event types alongside input
, such as keypress
, paste
and change
:
$(document).on("input keypress paste change", ".SomeClass", function () {
console.log("input entered");
});
JSFiddle demo.
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