Skip to main content

Bug Tracker

Side navigation

#12775 closed bug (notabug)

Opened October 22, 2012 01:12PM UTC

Closed October 22, 2012 01:59PM UTC

IE9 Has attribute selector returning element twice

Reported by: luigi.grilli@gmail.com 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>

Attachments (0)
Change History (2)

Changed October 22, 2012 01:24PM UTC by anonymous comment:1

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.

Changed October 22, 2012 01:59PM UTC by dmethvin comment:2

resolution: → notabug
status: newclosed