How To Stop Images From Being Dragged Using JQuery Or Javacsript

Posted by Weston Ganger


// Using jQuery
$('img').on('dragstart', function(event) { event.preventDefault(); });

// Using plain javascript, must do each image individually
document.getElementById('my-image').ondragstart = function() { return false; };


Related External Links:

Article Topic:Software Development - Javascript

Date:July 14, 2016

Recommended Posts