javascript select 获取 text 的值

<html>

 

<body>

 

<form>

<select name="cars" onchange="alert(this.options[this.selectedIndex].text)">

<option value="volvo">Volvo</option>

<option value="saab">Saab</option>

<option value="fiat">Fiat</option>

<option value="audi">ABC</option>

</select>

</form>

 

</body>

</html>

你可能感兴趣的:(JavaScript)