[jQuery] Checkbox: Selecting all Previous

[jQuery] Checkbox: Selecting all Previous

From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On Behalf Of Glen Lipka
Sent: Wednesday, November 29, 2006 9:52 AM
To: jQuery Discussion.
Subject: Re: [jQuery] Checkbox: Selecting all Previous
QUESTION OR FEATURE SUGGESTION
arrayPos() would return the index of the array.
 
So if I had 4 links with a class of "foo" and I clicked the third one,
$arrayPos(".foo", this) would return 3 (or 2 if it started at zero).
Maybe I should put this in a seperate message?
 
Glen
------
Actually I was looking over the suggestion I made earlier, and noticed that I didn't need to figure out the array position like I had. Here's the modified code.
$("input[@type=checkbox]").each(function (i) {
$(this).bind("click",function () {
$(this).siblings("input[@type=checkbox]").lt(i).each(function () {
$(this).attr({checked: 'true'});
}
)
}



















    • Topic Participants

    • alex