Opened 10 years ago
Closed 10 years ago
#12775 closed bug (notabug)
IE9 Has attribute selector returning element twice
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Using the has attribute selector on IE9 return the same item twice. You can see a jsfiddle reproducing this error here: http://jsfiddle.net/gigi81/3Vzse/4/
On IE9 the alert popups twice while on chrome and firefox only once (as it was supposed to be).
Here is the code for reference to reproduce the bug:
var callCount = 0;
$(function () {
$('[data-myattribute]').each(function () {
alert('call ' + (++callCount).toString());
});
});
<form action=""> <div data-myattribute="test" /> </form>
Change History (2)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Ok I found out that closing div tag is a non-void element must have an end tag. That's why I have the call twice. You can close this bug as that was the problem and not jQuery.