plz solve my query?

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
View the mysql querys by and my Php WebApp
ArrayList question plz solve it
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
plz try to clear my doubt for shuffling multi-dimensional array
plz check my codings are correct or not...There is an error..i cant find it..
Solve it
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
solve this
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
ModuleNotFoundError: No module named 'solve'
solve this pbm
how to solve
solve this pbm
ModuleNotFoundError: No module named 'plz-cmd'
ModuleNotFoundError: No module named 'pretty-plz'
Solve
how to solve this..

Ads