博客
关于我
获取select下的第一个option的自定义属性值
阅读量:344 次
发布时间:2019-03-04

本文共 170 字,大约阅读时间需要 1 分钟。

$('.com-opt').children().eq(3).data('sid');//获取值的正确写法$('select').children(1).data('sid');//错误写法//注意这种写法是不对的,菜鸟教程里面children()是不允许有值的(但是可以有类名),我们可以通过eq()来选取值,如有不对的地方,欢迎大家指正

转载地址:http://hedh.baihongyu.com/

你可能感兴趣的文章
node安装及配置之windows版
查看>>
Node实现小爬虫
查看>>
Node提示:error code Z_BUF_ERROR,error error -5,error zlib:unexpected end of file
查看>>