Wrong extraction of .attr("href") in IE7 vs all other browsers?
- by EmKay
Can it really be true that the attr("href") command for a link is handled very different in IE7 in comparison to all other browsers?
Let's say I have a page at http://example.com/page.html and I have this HTML:
<a href="#someAnchor" class="lnkTest">Link text</a>
and this jQuery:
var strHref = $(".lnkTest").attr("href");
Then in IE7 the value of the strHref variable will be "http://example.com/page.htm#someAnchor" but in other browsers it will be "#someAnchor".
I believe that the last mentioned case is the most correct one, so is it just a case of IE7 being a bad boy or is it a bug in jQuery?