首页 > Web开发 > 详细

jQuery匹配id 批量修改css属性

时间:2017-07-07 17:07:58      阅读:305      评论:0      收藏:0      [点我收藏+]
 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");

jQuery匹配id 批量修改css属性

原文:http://www.cnblogs.com/caixiaohua/p/7133055.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!