Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add an option 1

Status
Not open for further replies.

rkoya

IS-IT--Management
Jul 12, 2004
57
GB
Hi,

I want to add an option below.

<option value="4">4</option>

<form id="test">
<select id="lol">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>

This needs to be added using JS can any one help.

Thanks

Rishi
 
like so

Code:
document.getElementById("lol").options[3] = new Option("4","4");

Cheers

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top