Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.