Bug Tracker

Opened 12 years ago

Closed 12 years ago

#3659 closed bug (invalid)

Selector selects only 1 element...

Reported by: Urn Owned by:
Priority: major Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: first Cc: Urn
Blocked by: Blocking:

Description

EXAMPLE

$("#pc_block").each(function(){

alert("im not always executed!");

if ( ar[ $(this).attr('name') ] )

{$(this).show("slow"); } else

{$(this).hide("slow"); }

});

in some reason this statement executes only on first found element. but! if i make it like this

$("div[id=pc_block]").each ...

it executes on all elements on the page. ive noticed this bug before, but only now decided to submit a ticket. and this bug can be really hard to localize...

Change History (1)

comment:1 Changed 12 years ago by flesler

Cc: Urn added
Resolution: invalid
Status: newclosed

A document can't have more than 1 element with the same id, they have to be unique.

http://docs.jquery.com/Selectors/id#id

Note: See TracTickets for help on using tickets.