jquery click & get value of attributes of a href
http://stackoverflow.com/questions/6625667/jquery-click-get-value-of-attributes-of-a-href
/* Add a listner to Group buttons */
$('a.preActNav').click(function() {
alert(this.seq)
});
<li><a href="#preclose4" data-theme="a" data-icon="arrow-d" data-transition="none" seq='1' class="preActNav" ID="preActNavA">A</a></li>
<li><a href="#preclose4" data-theme="a" data-icon="arrow-d" data-transition="none" seq='2' class="preActNav" ID="preActNavB">B</a></li>
alert($(this).attr('seq'));
Although it may be better to put seq as another data element:
<li><a href="#preclose4" data-theme="a" data-icon="arrow-d" data-transition="none" data-seq='1' class="preActNav" ID="preActNavA">A</a></li>
So then you can do:
alert($(this).data('seq'));
jquery click & get value of attributes of a href的更多相关文章
- jquery click嵌套 事件重复注册 多次执行的问题解决
jquery click事件中嵌套click会重复注册内部的click事件,导致重复执行. 比如 $(...).click(function(){ $(...).click(function(){ ...
- jquery click事件,多次执行
用jquery绑定一个按钮click事件后,第一次点击后,一切正常,第二次点击,竟然执行两次,以后越来越多, 后来查看文档发现 jquery click 不是 替换原有的function 而是接 ...
- jquery click嵌套 事件重复注册 多次执行的问题
jquery click嵌套 事件重复注册 多次执行的问题 上面只是参考,我自己的解决方法是先使用unbind("click")解除事件然后再绑定新事件: $("#tes ...
- jquery click()方法 语法
jquery click()方法 语法 作用:当点击元素时,会发生 click 事件.当鼠标指针停留在元素上方,然后按下并松开鼠标左键时,就会发生一次 click.click() 方法触发 click ...
- chrome浏览器模拟手机端:jquery click()点击无效解决方法
$(".sku-wrap .ok").click(); chrome浏览器模拟手机端,在油猴插件中写JS代码,然后发现click()点击失效. 解决方法:jquery的click( ...
- jquery click()方法模拟点击事件对a标签不生效的解决办法
阅读数:8971 <a href="www.baidu.com"></a> 1 问题分析 点击A标签本身,并不会触发跳转到指定链接的事件,就是说,我们平时都 ...
- jquery click()方法模拟点击事件对a标签不生效
if(e.keyCode == 13) { $items.eq(index).click(); return; } 搜索框下拉列表模拟点击时间,使用上述代码不能触发链接跳转 1,页面使用了bootst ...
- jquery click 与原生 click 的区别
$.click() 触发的事件中没有 event.originalEvent , 不同触发 href="" 中的内容 $[0].click() 可以 <script type ...
- jquery click事件中的return false
提交表单数据时设定了type="submit"属性,单击提交按钮后会默认刷新页面 但是在使用jquery的click事件时没出现跳转 $('button').click(funct ...
随机推荐
- 在eclipse中查找指定文件
1.ctrl+h打开搜索界面 File Search: containing text填*,File name patterns填写hello.*,可以找到hello为命名的文件 知道文件类型,查找里 ...
- pm剩余要看的内容
1. thermal profiles tuning, customize thermal daemon for different thermal usage model 2.gas gauge d ...
- HDU 4407 Sum 容斥原理
Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Desc ...
- jmeter随笔(5)--断言中正则表达式的特殊字符问题和中文乱码显示问号的问题
最近在工作中,对jmeter实践的点滴的记录,这里分享交流,不一定正确,仅供参考和讨论,有想法的欢迎留言.谈论,手机上图片如果不清晰,请点击[阅读原文]查看. 问题:今天QQ群一朋友遇到jmeter的 ...
- python学习笔记(sqlalchemy安装失败)
博主今天折腾了一天sqlalchemy安装问题 下面是失败的截图 直接重新安装python2.7仍未解决此问题 最终在一国外论坛中找到解决的方法: 安装VC++对python的支持文件 VCForPy ...
- C/c++笔试经典程序(一)
1.输出结果比较 1) 输出结果:21 2) 输出结果:12.虽然循环只进行了一次,但是对!X++来说,X还是进行了自加运算. 2.指针运算 输出结果8,8.程序运行时,printf语句是从右往左进行 ...
- 3.5 The Lexical-Analyzer Generator Lex
3.5 The Lexical-Analyzer Generator Lex In this section, we introduce a tool called Lex, or in a more ...
- 读取计算机的OEM信息
只需要读取注册表里面的值即可 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation\Logo 下面有制 ...
- python中get、post数据
方法一:urllib2 参考:http://www.cnblogs.com/chenzehe/archive/2010/08/30/1812995.html post: #!/usr/bin/pyth ...
- SVN中取消冲突conflict
在SVN update代码出现冲突的时候,可以先右键点击SVN commit,在打开的窗口中单击红框内区域: 然后,再一次点击edit->mark as resolved,然后删除代码中> ...