javascript - Allow copy, paste and cut in textarea (Building keybord) -
i building keyboard want allow users copy, paste, cut keyboard short keys ctrl+c, ctrl+v ctrl+x. works when copy, paste or cut text in text area. later on can not type more text or edit current pasted text until refresh page.
<textarea id="write"></textarea>
jquery code:
$write = $('#write'); $write.keydown(function (event) { if(!event.ctrlkey) { event.preventdefault(); $write.html($write.html() + ' tmp'); } });
it's working when paste or cut text textarea after not work. check console , see text adding in textarea tags not shown in textarea. here working link http://projects.imube.com/keyboard/
Comments
Post a Comment