yyzhu 2014-04-12
<a href="http://www.baidu.com" title="en-x">百度</a> <a href="http://www.google.com" title="enp">谷歌</a> <a href="http://www.qq.com" title="en">腾讯</a>以下语句将使百度,腾讯字体变红
$("[title|='en']").css("color","red");
<input name="myNo1" value="myNo1"/> <input name="yourNo1" value="youNo1"/> <input name="hisNo1" value="hisNo1" /> <input name="*No" value="*No" /> <input name="no" value="no" />以下语句将使前四个字体变红
$("[name*=No]").css("color","red");
<input type="text" name="man woman" value="man woman"/> <input type="text" name="man1 woman1" value="man1 woman1" />使用以下语句:
$("[name~='man']").css("color","blue");
<input name="boygirl" value="boygirl" /> <input name="girlboy" value="girlboy" /> <input name="girlgirl" value="girlgirl" /> <input name="girlgirl1" value="girlgirl1" />使用如下代码:
$("[name$='girl']").css("background-color","red");;input的第一个,第三个背景将变色
<input name="man" value="man"/> <input name="woman" value="woman"/>使用如下代码:
$("[name='man']").css("background-color","blue");第一个input将背景将变色
<input name="man" value="man" /> <input name="woman" value="woman" /> <input name="children" value="children" />使用如下代码:
$("[name!='man']").css("color","green");input的第二个,第三个字体将变绿色
<input name="man1" value="man1"/> <input name="man2" value="man2"/> <input name="woman1" value="woman1"/>使用如下代码:
$("[name^='man']").css("color","red");input的第一个,第二个字体颜色将变红
<table id="table" class="table table-striped table-bordered table-hover table-nowrap" width="100%&qu