SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Jan 4, 2002, 18:04 #1
- Join Date
- Jan 2002
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
removing items from a dropDown List
I can add items dynamically to my dropDownList using the syntax:
oNewOption = new Option();
oNewOption.text = "yahoo";
oNewOption.value = "http://www.yahoo.com";
document.myform.SitesList.add(oNewOption, 1);
BUT, how can i remove items if i wanted to?
-
Jan 4, 2002, 22:55 #2
- Join Date
- Feb 2000
- Location
- where the World once stood
- Posts
- 700
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi jay,
fancy seeing you here.
<form name="b">
<select name='a'>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</form>
<script language='javascript'>
<!--
document.b.a.options.length--;
alert(document.b.a.options.length)
document.b.a.options[2] = null;
alert(document.b.a.options.length)
//-->
</script>
VinnyWhere the World Once Stood
the blades of grass
cut me still
Bookmarks