Disable copy paste in HTML without Javascript

html5 sample code

There are simple function available in HTML 5 itself to avoid drag & drop in the textbox or text area and disable paste in the textbox or text area.

HTML Tag onDrop to use to stop drag any items into the textbox / textarea

HTML Tag onPaste to use to stop paste values into the textbox / textarea.

Sample :-

<input type=”textare” ondrop=”return false;” onpaste=”return false;”>

<textarea rows=”4″ cols=”50″ ondrop=”return false;” onpaste=”return false;”>
CheckedResponsive.com Site
</textarea>

Leave a Comment