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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove option in select box

Status
Not open for further replies.

rkoya

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

I want to remove a value in a select box based dynamically.

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

I want option value 3 removed. Can anyone help on how to do this.

THanks

 
Hi

Code:
<form id="test">
[red]<select id="lol">[/red]
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
[red]</select>[/red]
</form>

[gray]# ...[/gray]

document.getElementById('lol').options[2]=null

Feherke.
 
Thanks worked perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top