Ali Ahmad
plz solve my query?
1 Answer(s)      6 years and a month ago
Posted in : JavaScript Questions

how to remove all the options from select control in html using java script?


View Answers

February 22, 2011 at 11:51 AM

JavaScript remove all items

<script language="javascript" >

function removeAllItems(selectbox)
var i;
<form name="list">
<select id="item" NAME="item">
<option value="one">One</option>
<option value="two">two</option>
<option value="three">three</option>
<option value="four">four</option>
<option value="five">five</option>
<input type="button" value="Remove All Item" onClick="removeAllItems(item);">