...

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



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

Picco

nikkiH
09-27-2005, 04: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