-

xiyueta().parsejquery() 属性方法

解析jquery查询方式
快速上手

xiyueta().parsejquery()属性方法,二种调用方式:
1、xiyueta().parsejquery(); //不跟参数则使用之前的查询文本
2、xiyueta().parsejquery(txt); //使用当前的文本进行查询

总结:解析jquery查询方式,以数组方法显示
尝试一下>>

  • 代码
  • 效果
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script>
<script>xiyueta.load("<br>");
xiyueta.log( xiyueta("* div ul > li[class]:eq(0)").parsejquery() )
xiyueta.log( xiyueta("* div ul > li").parsejquery("a[href]:eq(0)") )

</script>
0:
0:
0: tag
1: *
length: 2

1:
0: tag
1: div
length: 2

2:
0: tag
1: ul
length: 2

3:
0: >
length: 1

4:
0: tag
1: li
length: 2

5:
0: [
1: class
length: 2

6:
0: :
1: eq
2: 0
length: 3

length: 7

length: 1


0:
0:
0: tag
1: a
length: 2

1:
0: [
1: href
length: 2

2:
0: :
1: eq
2: 0
length: 3

length: 3

length: 1