禁止图片img拖动

js原生解决方法 :

document.getElementsByTagName('img')[0].onmousedown = function(e){
    e.preventDefault()
};

猜你喜欢

转载自blog.csdn.net/weixin_42398560/article/details/82776639