`
tanglong8848
  • 浏览: 67268 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

单选按钮事件

 
阅读更多

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<style>
div#green {background:#00FF00;width:100px;height:100px;}
div#blue {background:#0000FF;width:100px;height:100px;}
</style>
<Script Language="JavaScript">
function showthis(){
var colorthis=document.form1;
if(colorthis.cc[0].checked){
green.style.display="";

}
else{
green.style.display="none";

}
}
</Script>
<Script Language="JavaScript">

function test(id){
var test=id;
if(document.getElementById(test).value){
document.getElementById(test).value= "";
}
}


</Script>

<form name="form1" id="form1" action="" method="post" enctype="multipart/form-data"><input type="text" name="tt" id="tt" disabled onfocus="test('tt')" value="test"/>
<input id="cc" name="cc" type="radio" value="1" onclick="showthis()" />点我显示绿
<input id="cc" name="cc" disabled type="radio" value="0" onclick="showthis()" checked="checked" />点我显示蓝


<table id="two">
<table id="green" style="display:none">
<tbody >
<tr>testpage</tr>
</tbody></table>
</table>

</form>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics