粗略写法如下:
//--------------------
<script>
function goto(){
var cked=document.getElementsByName("link");
var content=document.getElementById("con");
for(var i=0;i<cked.length;i++){
if(cked[0].checked){
content.innerHTML="链接网站:<input type=text size=50>";
return false;
break;
}
if(cked[1].checked){
content.innerHTML="this is adv";
return false;
break;
}
if(cked[2].checked){
content.innerHTML="this is temp";
return false;
break;
}
}
}
</script>
<body>
<input type="radio" name="link" id="k1" value="url" onclick="goto();" checked>网址
<input type="radio" name="link" id="k2" value="adv" onclick="goto();">广告
<input type="radio" name="link" id="k3" value="template" onclick="goto();">模板
<div id="con">链接网站:<input type=text size=50></div>