js switch 教程
function tybsoso(son){
tnum=son;
var qtext1=document.getElementById('qbtext1').value;
var qtext2=document.getElementById('qbtext2').value;
var qtext3=document.getElementById('qbtext3').value;
var qtext4=document.getElementById('qbtext4').value;
switch (tnum)
{
case '1':
gotourl="http://data.2008.163.com/searchs/index.html?q="+qtext1;
gotourl=encodeURI(gotourl);
break;
case '2':
gotourl="http://data.2008.163.com/searchs/news.html?q="+qtext2;
gotourl=encodeURI(gotourl);
break;
case '3':
gotourl="http://data.2008.163.com/searchs/data.html?q="+qtext3;
gotourl=encodeURI(gotourl);
break;
case '4':
gotourl="http://data.2008.163.com/searchs/image.html?q="+qtext4;
gotourl=encodeURI(gotourl);
break;
}
window.open(gotourl);
}
补充:网页制作,js教程