我想禁用div中的所有链接,并将其替换为那里的内容.
即
<div><a href="/blah.html">My super link</a></div>
Run Code Online (Sandbox Code Playgroud)
至
<div>My super link</div>
Run Code Online (Sandbox Code Playgroud)
谢谢
你可以使用.replacewith()和一个函数来做,像这样:
?$("div a").replaceWith(????function() { return $(this).text();? });?
Run Code Online (Sandbox Code Playgroud)