[jQuery] Re: get values from a select menu then assign them to an array variable

2009-09-09 Thread KeeganWatkins
Hi runrunforest, To elaborate on Benn's explanation, the $.each and $().each() methods provide two arguments inside the callback you supply. The first is the index (either an enumerated key for arrays or a string key for objects). The second is the value (the value associated with the current key

[jQuery] Re: get values from a select menu then assign them to an array variable

2009-09-08 Thread Benn
i is the count for the each statement making a key for the array: for example the first dropdown option would have an array key/value pairing of '0','com1' On Sep 8, 2:06 am, runrunforest wrote: > Owsome Benn. But i don't understand why "i" is used there ?

[jQuery] Re: get values from a select menu then assign them to an array variable

2009-09-08 Thread runrunforest
Owsome Benn. But i don't understand why "i" is used there ?

[jQuery] Re: get values from a select menu then assign them to an array variable

2009-09-08 Thread Benn
var laArray = new Array(); $(document).ready(function(){ $(".cat2 option").each(function(i){ laArray[i] = $(this).val(); }) alert(laArray) }) On Sep 7, 11:20 pm, runrunforest wrote: > Hi, > > I have a menu like this: > >     >         vaio >         think