Trigger event automatically on DOMCharacterChanged or change to div
so basically i have div
here contenteditable
and a button
on click
from which content changes div
! Now what I want is automatically started event
for div
after content changes.
Note. I am using jQuery version 1.8.2
I have tried as below but no success.
<div contenteditable id="divtxt">First Text</div>
<button id="btnChange">Change</button>
Js
$('#divtxt').bind("DOMCharacterDataModified",function(){
alert('this is the event of div');
});
$('#btnChange').bind('click',function(){
$("#divtxt").text('Text Changed on click');
});
any help is appreciated!
+3
source to share