HTML中的特定文本:使用jQuery .filter()選擇DIV
<p class="greeting">
hello, my name is kevin. what's yours?
</p>
的jQuery:
$("p.greeting").filter(function(){
return $this.text() === "my name is";
}).css("background", "green");
我試圖孤立的話 「我的名字叫」 在<p class="greeting">
標籤。任何人都可以幫助我與jQuery,因爲它似乎不工作。謝謝。
可能的重複http://stackoverflow.com/questions/926580/find-text-string-using-jquery – motoxer4533