Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
更改此元素的最简单方法是什么:
<a href="pic.png">
进入:
<img src="pic.png">
采用replaceWith
replaceWith
$('a').replaceWith(function() { return $('<img/>').attr('src', this.href); });
替换'a'为您需要替换的链接的选择器。
'a'