Jquery选择器以及JQuery属性获取 attr

来源:互联网 发布:linux ssh远程工具 编辑:程序博客网 时间:2024/06/03 17:50

 var ctype = $(".people-askclass li a.act:eq(0)").attr('data-ctype')

解释: 第一个 li 下面  a 标签 带act 样式的 含 ‘data-ctype’属性的值

 切记   a.act:eq(0)  中间不能有空格 


原创粉丝点击