css查找与替换,指定索引
xiyuetaCSS().cssall()属性方法,2种调用方式:
1、xiyuetaCSS(".nav").cssall("color",0); //获得CSS标记的参数对应的值,索引为0
1、xiyuetaCSS(".nav").cssall("color",0,'red'); //设置CSS标记的参数对应的值,索引为0
总结:xiyuetaCSS().cssall("color",0,"") 第三个参数如果为空的话则为删除
尝试一下>>
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script> <script>
var css= 'div{color:red;color:blue;color:yellow}' xiyuetaCSS.load(css); var s = xiyuetaCSS("div").cssall("color",2);//查询 xiyueta.log("color",s)
</script>
color yellow