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
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
Please Help To Solve My Problem
plz solve this program - Java Interview Questions
OCI Connectivity For Oracle Plz Solve This Error
OCI Connectivity For Oracle Plz Solve This Error
Small Bug How to solve in my code
help me about to solve my qustion
plz. answer my ques - Java Beginners
Solve it
plz try to clear my doubt for shuffling multi-dimensional array
sir plz do respond to my problem immediately - Java Beginners
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
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..
solve this pbm
how to solve
Solve
solve this pbm
plz plz plz inform me as soon as possible
how to solve this..
how to solve this..
solve this problem
plz help
plz give me answer plz

Ads