A generic solution especially for Windows Edge browser (as the -ms-user-select: none; CSS rule doesn't work):
window.ondragstart = function() {return false}
Note: This can save you having to add draggable="false"
to every img
tag when you still need the click event (i.e. you can't use pointer-events: none
), but don't want the drag icon image to appear.