Bug Tracker

Opened 7 years ago

Closed 7 years ago

#12775 closed bug (notabug)

IE9 Has attribute selector returning element twice

Reported by: luigi.grilli@… 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 7 years ago by anonymous

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.

comment:2 Changed 7 years ago by dmethvin

Resolution: notabug
Status: newclosed
Note: See TracTickets for help on using tickets.