admin管理员组

文章数量:1315322

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

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

Share Improve this question edited Sep 1, 2011 at 19:20 Amr Elgarhy asked Sep 1, 2011 at 17:11 Amr ElgarhyAmr Elgarhy 69.1k70 gold badges192 silver badges310 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 9

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.

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

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

Yes the attributes name is disabled:

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

本文标签: javascripthow to disable drop text inside a textareaStack Overflow