Hi,
I seem to be struggling grabbing all select lists first option that are within a particular fieldset ID, and altering their attrbibutes.
I have tried
or
But all it does is reset the first select list not all of them.
I've tried various selector methods using the child chevron '>' , but I can't work it out.
I've thought perhaps I should get all select lists, then for each get their first option, but I don't know how to do a selector against $(this)?
Is it possible to get an array (or JQuery object) of all select lists first options and manipulate them in this way?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads
I seem to be struggling grabbing all select lists first option that are within a particular fieldset ID, and altering their attrbibutes.
I have tried
Code:
$('#filters select option:first').each(function(){
$(this).attr('selected',true);
});
or
Code:
$('#filters select option:first').attr('selected',true);
But all it does is reset the first select list not all of them.
I've tried various selector methods using the child chevron '>' , but I can't work it out.
I've thought perhaps I should get all select lists, then for each get their first option, but I don't know how to do a selector against $(this)?
Is it possible to get an array (or JQuery object) of all select lists first options and manipulate them in this way?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads