javascript - Jquery text change event -
i need fire event anytime content of textbox has changed.
i cant use keyup nor can use keypress.
keyup , keydown doesn't work if hold down on key.
keypress triggers before text has changed. doesn't recognize backspace or delete either.
so i'm assuming i'm going have build custom logic or download plugin. there plugins out there? or if should build one, constraints should out for?
for eg. facebook search @ top. can press , hold.
another example writing stackoverflow question. right below editor, contents copied in real time, backspace , everythng works. how it?
i took @ so's source. looks lot this:
function updatepreview(){ $('div').text($('textarea').val()); } $('textarea').bind('keypress', function(){ settimeout(updatepreview, 1); } );
they stuff make html tags bold , italics , links , such , time it. increase delay 1 longer if takes long generate html.
Comments
Post a Comment