Why does this argument in jQuery return href with bindings
I have this for example:
<div id="example">
<a href="http://www.google.com/#1">Hello</a>
<a href="http://www.google.com/#4">Hello</a>
</div>
And this two lines of jQuery:
jQuery("a").filter(function() {
console.log(""+this+"")
});
Return:
http://www.google.com/#1
http://www.google.com/#4
But
jQuery("a").filter(function() {
console.log(this);
});
Returns
<a href="http://www.google.com/#1">Hello</a>β
<a href="http://www.google.com/#4">Hello</a>β
Why line 2 returns the HREF attribute of the anchor IF 'this' argument, adds the line? JQuery docs say that if a filter has a function argument,"this" is the current DOM element
+5