How to make textArea handle multiple events the same?

梦想的初衷 提交于 2019-12-25 04:27:12

问题


I want to make my text area handle onCut, onPaste, onKeydown and onKeyup the same. I.e. they all affect the textArea the same.

I am creating the javascript as a string and using it within Codeigniter.

Currently, in my code below, none of the functions are working when all together, How can I fix this?

Note: when the code is only:

$javascript= 'onKeyDown || onKeyUp="exampleFunction()"';

It works fine, but doesn't work with:

$javascript= 'onKeyDown || onKeyUp || onPaste || onCut="exampleFunction()"';

Where javascript being called:

echo form_textarea('text',0,$javascript);

来源:https://stackoverflow.com/questions/28565396/how-to-make-textarea-handle-multiple-events-the-same

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!