Skip to main content

Bug Tracker

Side navigation

#10272 closed bug (invalid)

Opened September 14, 2011 03:30AM UTC

Closed September 14, 2011 11:19PM UTC

Add parameters to element.each()

Reported by: jquery@michaelcole.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.4rc1
Keywords: Cc:
Blocked by: Blocking:
Description

Hi, I have a series of selects. Each select must have a different value when submitted. When changing a select, I must find all other selects and change them to "none".

The current form of each() doesn't appear to allow me to pass the "value" as a context to the function. E.g. if I choose "red", I can't pass "red" through each to the function that changes "red" to "none".

"red" could be passed by adding another parameter to each() cnanging it from:

.each( function(index, Element) )

to:

.each( function (index, Element, context), context)

Context would of course be optional.

http://api.jquery.com/each/

Mike

Attachments (0)
Change History (2)

Changed September 14, 2011 03:30AM UTC by anonymous comment:1

... I must find all other selects WITH THE SAME VALUE and change them to "none"...

Changed September 14, 2011 11:19PM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

Use a closure. Ask on the forum if you need further help.