|
Q1448 How do I unselect the highlighted item of a drop down list?
irt.org | Knowledge Base | JavaScript | Form | Q1448 [ previous next ]
Q1448 How do I unselect the highlighted item of a drop down list?
Try:
<script language="JavaScript"><!--
document.myform.mySelect.selectedIndex=-1;
//--></script>
|
or:
<form name="myform">
<select name="myselect">
<option value="">---- Select something ---
<option value="1">One
....
</select>
</form>
|
and use:
<script language="JavaScript"><!--
document.myform.myselect.options[0].selected = true;
//--></script>
|
or possibly (but I have never used it):
<script language="JavaScript"><!--
document.myform.myselect.options[document.myform.myselect.selectedIndex].selected = false;
//--></script>
|
Feedback on 'Q1448 How do I unselect the highlighted item of a drop down list?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.