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



Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected