$(function() {
$("#state option").each(function(i){
alert($(this).text() + " : " + $(this).val());
});
});
Will do it.
Try here for a nice API reference:
http://www.visualjquery.com/
It'll answer a ton of your questions.
Adrian
On Oct 26, 6:41 pm, "[EMAIL PROT
The code Wizzud gave is pretty good.
To get a value and label just use the attr function.
jQuery('#state option').each(function(i){
alert($(this).attr("value"));
alert($(this).attr("label"));
});
Glen
On 10/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> Thanks, can yo
Hi,
Thanks, can you show sample code of accessing every element's value
and label?
On Oct 27, 1:30 am, Wizzud <[EMAIL PROTECTED]> wrote:
> jQuery('#state option').each(function(i){
>
> });
>
> On Oct 26, 5:49 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Hi,
>
> > given th
jQuery('#state option').each(function(i){
});
On Oct 26, 5:49 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> given this, how to iterate thru the options? thanks
>
>
> New York
> Alaska
> Kentuky
> IOWA
>
4 matches
Mail list logo