博客
关于我
获取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/

你可能感兴趣的文章
nginx总结及使用Docker创建nginx教程
查看>>
nginx报错:the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:128
查看>>
nginx报错:the “ssl“ parameter requires ngx_http_ssl_module in usrlocalnginxconfnginx.conf128
查看>>
Nginx搭建RTMP服务器+FFmpeg实现海康威视摄像头预览
查看>>