View Full Version : easy way to remove all items from a select box?
Darksbane
11-24-2002, 08:22 PM
Is there a way to remove every item from a select box at the same time, or is it necessary to loop through each one and set it to null?
Thanks
Darksbane
whammy
11-24-2002, 08:45 PM
<form id="blah" action="javascript://">
<select name="fubr">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select><br />
<input type="button" value="!eM kcilC" onclick="this.form.fubr.options.length = 0" />
</form>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.