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
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 ?
Owsome Benn. But i don't understand why "i" is used there ?
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
4 matches
Mail list logo