<
html
>
< head >
< title > aaa </ title >
< script language ="javascript" >
function getFruit()
{
var v = document.getElementById( " fruit " ).options[document.getElementById( " fruit " ).selectedIndex];
alert(v.value + v.text);
}
</ script >
</ head >
< body >
< select name ="fruit" >
< option value ="apple" > 苹果
< option value ="orange" > 桔子
< option value ="mango" > 芒果
</ select >
< input type ="submit" value ="提交" onclick = getFruit() >
</ body >
</ html >
< head >
< title > aaa </ title >
< script language ="javascript" >
function getFruit()
{
var v = document.getElementById( " fruit " ).options[document.getElementById( " fruit " ).selectedIndex];
alert(v.value + v.text);
}
</ script >
</ head >
< body >
< select name ="fruit" >
< option value ="apple" > 苹果
< option value ="orange" > 桔子
< option value ="mango" > 芒果
</ select >
< input type ="submit" value ="提交" onclick = getFruit() >
</ body >
</ html >