为空或不是对象,急死了! document.getElementById("SE").outerHTML这里改成document.getElementById("SE").innerHTML 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.getElementById("SE").outerHTML改用innerHTML function test(){ document.getElementById("SE").innerHTML=document.getElementById("Product").options[document.getElementById("Product").selectedIndex].value; } 乱搞当然出不来,好好看看参考手册吧!<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title> New Document </title><meta name="Generator" content="EditPlus"><meta name="Author" content=""><meta name="Keywords" content=""><meta name="Description" content=""></head><body><SCRIPT language=javascript>function test(){ var oSelect = document.getElementById("ClassInfo"); var oDiv = document.getElementById("SE"); oDiv.innerHTML = oSelect.options[oSelect.selectedIndex].text;}</script>信息分类:<SELECT id="ClassInfo" runat="server" onchange="javascript:test();"><OPTION selected></OPTION><OPTION>技术资料</OPTION><OPTION>市场资料</OPTION><OPTION>政策法规</OPTION><OPTION>其他</OPTION></SELECT><div id="SE"></div></body></html> 谁能告诉我,《JavaScript高级程序设计(第4版)》什么时候出来啊? tagName的问题 弱弱的问一下,有没有在成都的熟悉JS的朋友 页面刷新的问题。 用脚本调用另一个页面的脚本的问题(A页面脚本调用 B页面脚本) [原创] 一个多级联动js代码,js面像对象方式编写,WEB开发你一定能够用到! 奇怪,document 对象引用不到元素了? 怎样弹出上传页面? JavaScript将在哪一年被淘汰? 对csdn论坛的一点点技术上的改进(关于tacontent.htc的绑定问题),欢迎讨论。 如何判断两个标签是否相同? 新手提问:如何检查一个页面中是否含有<form>对象
改用innerHTML
document.getElementById("SE").innerHTML=document.getElementById("Product").options[document.getElementById("Product").selectedIndex].value;
}
乱搞当然出不来,好好看看参考手册吧!<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head><body>
<SCRIPT language=javascript>
function test()
{
var oSelect = document.getElementById("ClassInfo");
var oDiv = document.getElementById("SE");
oDiv.innerHTML = oSelect.options[oSelect.selectedIndex].text;
}
</script>
信息分类:
<SELECT id="ClassInfo" runat="server" onchange="javascript:test();">
<OPTION selected></OPTION>
<OPTION>技术资料</OPTION>
<OPTION>市场资料</OPTION>
<OPTION>政策法规</OPTION>
<OPTION>其他</OPTION>
</SELECT>
<div id="SE"></div>
</body>
</html>