You are here: irt.org | FAQ | JavaScript | Form | 3.5 | Q521 [ previous next ]
Yes:
<script language="JavaScript"><!-- function changeSelect(x) { document.myForm.mySelect.selectedIndex = x-1; } //--></script> <form name="myForm"> <select name="mySelect"> <option>Option 1 <option>Option 2 <option>Option 3 <option>Option 4 </select> </form> <a href="javascript:changeSelect(1)">Change it to 1</a> <a href="javascript:changeSelect(2)">Change it to 2</a> <a href="javascript:changeSelect(3)">Change it to 3</a> <a href="javascript:changeSelect(4)">Change it to 4</a>