View Full Version : reset a drop-down menu in JavaScript

09-27-2005, 03:15 PM
is there a way to reset a drop-down menu?


09-27-2005, 03:20 PM
Reset it to what?
"drop-down menu" meaning a form select element, I assume...

You can set it by setting selectedIndex and selected properties (cross-browser needs both).

document.formName.selectName.selectedIndex = 0;
document.formName.selectName.options[0].selected = true;

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum