1
4

2 回答 2

2
于 2012-10-14T14:05:36.787 回答
2

使用attr()方法

$(".someClass").click(function(e) {
    e.preventDefault();
    // How to get value of someAttribute?
   alert( $(this).attr('someAttribute'));
});

演示:http: //jsfiddle.net/buC8k/

API参考:http: //api.jquery.com/attr/

于 2012-10-14T14:06:18.007 回答