jQuery匹配id 批量修改css属性
1 <ul id="foreignCurrencyTree_1_ul"> 2 <li id="foreignCurrencyTree_11_li">111111</li> 3 <li id="foreignCurrencyTree_12_li">222222</li> 4 <li id="foreignCurrencyTree_13_li">333333</li> 5 </ul> 6 <ul id="foreignCurrencyTree_2_ul"> 7 <li id="foreignCurrencyTree_21_li">111111</li> 8 <li id="foreignCurrencyTree_22_li">222222</li> 9 <li id="foreignCurrencyTree_23_li">333333</li> 10 </ul>
[属性名称] 匹配包含给定属性的元素
[att=value] 匹配包含给定属性的元素 (大小写区分)
[att*=value] 模糊匹配
[att!=value] 不能是这个值
[att$=value] 结尾是这个值
[att^=value] 开头是这个值
[att1][att2][att3]... 匹配多个属性条件中的一个
设置所有ul的overflow属性为hidden。
$('[id^=foreignCurrencyTree_][id$=_ul]').css("overflow","hidden");
设置所有li的display属性为inline
$('[id^=foreignCurrencyTree_][id$=_li]').css("display","inline");
设置所有ul的overflow属性为hidden。
$('[id^=foreignCurrencyTree_][id$=_ul]').css("overflow","hidden");
设置所有li的display属性为inline
$('[id^=foreignCurrencyTree_][id$=_li]').css("display","inline");