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)
ません (「未定義」と表示されます)。どうすれば入手できますか?