我想要做的是从此
中删除网址<h1 itemprop="name" id="book"><a href="http://www.example.com/book/=/book_num/xxxxxxxxx.html"
itemprop="url">name of book</a></h1>
将提供此
<h1 itemprop="name" id="name2">name of book</h1>
请注意,url中的xxxxxxxxx在每个链接中都有所不同
答案 0 :(得分:0)
/*--- Use the jQuery contains selector to find content to remove.
Beware that not all whitespace is as it appears.
*/
var badDivs = $("div div:contains('Annoying text, CASE SENSITIVE')");
badDivs.remove ();
答案 1 :(得分:0)
经过一些研究得到它
$("#book a").removeAttr("href");