how to disable drop text inside a textarea?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 09:37:26

问题


How to prevent users from dragging and dropping text inside a textarea? is there an attribute which control this or need some js code?

Want to disable drop but not to make it readonly


回答1:


What you want to do is an usability fault, but never mind...

<textarea ondrop="return false;">

I assume you don't want to disable normal typing into it.




回答2:


<textarea ondragstart="return false" ondrop="return false">

While am trying with this code,its working fine in all browsers....




回答3:


Yes the attributes name is disabled:

<textarea disabled="disabled"></textarea>


来源:https://stackoverflow.com/questions/7273883/how-to-disable-drop-text-inside-a-textarea

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