< html > < body > < form name = "t_form" > < select name = "t_select" > < option value = "first" selected > 1 < / option > < option value = "second" > 2 < / option > < / select > < / form > < script > var obj = document.forms[‘t_form‘].t_select var index = obj.selectedIndex; alert(obj.options[index].value) < / script > < / body > < / html >
时间: 2024-10-26 10:41:05