By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,251 Members | 1,656 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,251 IT Pros & Developers. It's quick & easy.

How to Get the "Value" from the <options> tag?

P: 9
I'm trying to sort a select list using javascript...using :


<option value="1">zebra</option>

Expand|Select|Wrap|Line Numbers
  1. var a = document.getElementById('mylist').options[i].text;
Expand|Select|Wrap|Line Numbers
  1. var a = document.getElementById('mylist').options[i].value;
Nov 7 '07 #1
Share this Question
Share on Google+
1 Reply

P: 9
argh!!! my mistake, now it works....sorry
Nov 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.