87,909
社区成员
发帖
与我相关
我的任务
分享
<script>
document.write('<select id="sel" onchange="aa(this)"><option>1</option><option>2</option></select>');
function aa(t){
var value = t[t.selectedIndex].innerHTML;
alert(value)
};
</script>
<select id="sel"><option>1</option><option>2</option></select>
<script>
document.getElementById('sel').onchange = function(){
var value = this[this.selectedIndex].innerHTML;
alert(value)
};
</script>