动态改变 Select 内容
[url=http://www.jaron.cn/][/url]
<html>
<HEAD>
<title>例子</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT LANGUAGE="JavaScript">
var meng1Array = new Array("('选择Heha.net栏目内容','',true,true)",
"('学习 XML')",
"('学习 Javascript')",
"('学习 PHP')");
var mengArray = new Array("('选择Myrice.com栏目内容','',true,true)",
"('学习 Flash')",
"('学习 Dreamweaver Ultradev')",
"('学习 Java')");
var meng2Array = new Array("('选择China.com栏目内容','',true,true)",
"('查找歌词')",
"('其他')");
function populatemxhweb(inForm,selected) {
var selectedArray = eval(selected + "Array");
while (selectedArray.length < inForm.mxhweb.options.length) {
inForm.mxhweb.options[(inForm.mxhweb.options.length - 1)] = null;
}
for (var i=0; i < selectedArray.length; i++) {
eval("inForm.mxhweb.options[i]=" + "new Option" + selectedArray[i]);
}
if ( navigator.appName == 'Netscape') {
if (parseInt(navigator.appVersion) < 4) {
window.history.go(0);
}
}
//以下不影响
}
</script>
<link rel="stylesheet" href="../css/css.css" type="text/css">
</head>
<body topmargin="0" leftmargin="0" marginweight="0" marginheight="0" bgcolor="#0099FF" oncontextmenu="return false;"><p> </p>
<font color="#000066">说明:适用于IE4,IE5.5,IE5,NS4+,NS6。早期版本的IE5.0可能无法工作。</font>
<center>
<form name="globe">
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select onChange="populatemxhweb(document.globe,this.options[selectedIndex].value)">
<option value="meng">http://lucky.myrice.com
<option value="meng1">http://go.163.com/colorweb
<option value="meng2">http://egirl.51.net
</select>
</td>
<td>
<select name="mxhweb" onChange="window.open('http://egirl.51.net')">
<option value=''>☆ 请选择上面的选项 ☆</option>
</select>
</td>
</tr>
</table>
<br>
<br>
<br>
<br>
<br>
<input type="button" value="关闭本页" onclick="window.close()">
</form>
</center>
</body>
</html>