我正在尝试从 a 中删除加载的图像<img>
元素,但清除或删除 src 不会执行此操作。该怎么办?
HTML:
<img src='https://www.google.com/images/srpr/logo3w.png'>
JQUERY:
$('img').attr('src', ''); // Clear the src
$('img').removeAttr('src'); // Remove the src
图像仍然...
fiddle: http://jsfiddle.net/6x9NZ/ http://jsfiddle.net/6x9NZ/
你必须要么remove http://api.jquery.com/remove/ the <img>
完全元素或将其替换为不同的图像(可以是透明的 gif)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)