plz solve my query?

Ads
 

plz solve my query?

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

<html>
<script language="javascript" >

function removeAllItems(selectbox)
{
var i;
for(i=selectbox.options.length-1;i>=0;i--)
{
selectbox.remove(i);
}
}
</script>
<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>
</select>
<br>
<input type="button" value="Remove All Item" onClick="removeAllItems(item);">
</form>
</html>

Ads









Related Tutorials/Questions & Answers:
plz solve my query?
plz anyone can solve my
Advertisements
ArrayList question plz solve it
View the mysql querys by and my Php WebApp
plz help meto solve this question
Solve my code
solve my question shortly
OCI Connectivity For Oracle Plz Solve This Error
OCI Connectivity For Oracle Plz Solve This Error
Please Help To Solve My Problem
Small Bug How to solve in my code
help me about to solve my qustion
Solve it
plz try to clear my doubt for shuffling multi-dimensional array
solve this
plz check my codings are correct or not...There is an error..i cant find it..
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
solve this pbm
ModuleNotFoundError: No module named 'solve'
how to solve
solve this pbm
Solve
plz help
ModuleNotFoundError: No module named 'plz'
ModuleNotFoundError: No module named 'plz'
plz give me answer plz
Plz Help
plz help me for this question
how to solve this..
how to solve this..
solve this problem

Ads