获得匹配元素集中的第一个元素中标签属性名数组列表
xiyueta().getLabelParamList()属性方法,二种调用方式:
1、xiyueta("div").getLabelParamList(); //获得匹配元素集中的第一个元素中标签属性名数组列表
2、xiyueta("div").getLabelParamList("value"); //获得匹配元素集中的第一个元素中标签属性值数组列表,或 xiyueta("div").getLabelParamValueList() 也可以
总结:
.getLabelParamList()获得匹配元素集中的第一个元素中标签参数列表,如果dom不存在,则返回空数组
尝试一下>>
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script> <script>
var html="<div id='nav' hidden class='classname' name='ttt'></div><div id='news' class='classname2' style='color:red'></div>" xiyueta.load(html) xiyueta.log( xiyueta("div").getLabelParamList() )
</script>
0: id
1: hidden
2: class
3: name
length: 4