1
我想更改包含href中指定單詞的元素的樣式。更改包含指定單詞的元素的樣式
jQuery的
jQuery('a:contains("afyon")').css('color': '#fff');
HTML
<div class="saglink"><a title="bayan adana" href="http://www.site.co/adana-bayan/">Adana bayan</a></div>
<div class="saglink"><a title="bayan adiyaman" href="http://www.site.co/adiyaman-bayan/">Adıyaman bayan</a></div>
<div class="saglink"><a title="bayan afyon" href="http://www.site.co/afyon-bayan/">Afyon bayan</a></div>
<div class="saglink"><a title="bayan aksaray" href="http://www.site.co/aksaray-bayan/">Aksaray bayan</a></div>
什麼是做正確的方法是什麼?
http://stackoverflow.com/questions/1777357/css-rule-based-on-content – 2014-09-06 17:37:50