我想获取标签的href
值。当我做 hash
a
$(document.body).on('click',"a",function(event){
console.log($(this));
});
我看到一个类似的物体
[a.internalLink, context: a.internalLink, jquery: "1.10.2", constructor: function, init: function, selector: ""…]
0: a.internalLink
accessKey: ""
attributes: NamedNodeMap
...
hash: "#abc.1.2"
...
href: "http://www.example.com/page.html#abc.1.2
...
但是当我试图通过 获取值时console.log($(this).href)
,它就不起作用(打印出“未定义”)。我怎么才能得到它?