<select onchange="window.location.href='test.asp?id=' + this.value;">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<head>
<title></title>
<script>
function showtable()
{
//window.location.href='Default.aspx?'
var newselect=document.getElementById("se");
var newtable=document.getElementById("t1").insertRow(-1);
var checkvalue=newselect.value;
for(var i=0;i<newselect.length;i++)
{
var newtr=document.createElement("tr");
var newtd=document.createElement("td");
newtd.innerHTML=newselect[i].value;
newtable.appendChild(newtr);
newtr.appendChild(newtd);
}
}
</script>
</head>
<body>
<form action="#">
<select id="se" onchange="showtable()">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<table id="t1" border=1>
<tr>
</tr>
</table>
</form>
</body>
</html> 是这个意思吗
<html>
<head>
<title></title>
<script>
function showtable()
{
delTable();//调用方法
//window.location.href='Default.aspx?'
var newtable=document.getElementById("t1").insertRow(-1);
var newselect=document.getElementById("se");
var checkvalue=newselect.value;
var newtr=document.createElement("tr");
var newtd=document.createElement("td");
newtd.innerHTML=checkvalue;
newtable.appendChild(newtr);
newtr.appendChild(newtd);
for(var i=0;i<newselect.length;i++)
{
if(newselect[i].value==checkvalue)
{
}else
{
newtr=document.createElement("tr");
newtd=document.createElement("td");
newtd.innerHTML=newselect[i].value;
newtable.appendChild(newtr);
newtr.appendChild(newtd);
}
}
}
//清楚表格
function delTable()
{
var testTable = document.getElementById("t1");
while(testTable.hasChildNodes()){
testTable.removeChild(testTable.lastChild);
}
}
</script>
</head>
<body>
<form action="#">
<select id="se" onchange="showtable()">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<table id="t1" border=1>
<tr>
</tr>
</table>
</form>
</body>
</html>
发到我的qq邮箱[email protected]