删除超链接但保留文字? [英] Remove hyperlink but keep text?
本文介绍了删除超链接但保留文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<a href="http://www.website.com/something" title="Show Profile">Mentalist</a>
每当超链接的标题为显示配置文件时,我想删除超链接并将其替换为只有文字。
Whenever a hyperlink has a title of "Show Profile" I want to remove the hyperlink and replace it with only with the text.
所以而不是
<a href="http://www.website.com/something" title="Show Profile">Mentalist</a>
我想只有 Mentalist
。
任何想法如何解决?
推荐答案
这应该有效:
$('a[title="Show Profile"]').contents().unwrap();
小提琴带证明。
这篇关于删除超链接但保留文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文