php 实现其中的单选按钮控制文本框的显示与隐藏

来源:互联网 发布:unity3d灯光教程 编辑:程序博客网 时间:2024/05/17 01:05

<html><head> </head><body><table cellspacing="1" cellpadding="6" class="tb"><tr><td class="tl"><span color="f_red">选择类型</span></td><td class="tr"><input type="radio" name="istype" value="1" /> 隐藏    <input type="radio" name="istype" value="0" checked /> 显示  </td></tr><tr id="333"><td class="tl"><span color="f_red">bb</span></td><td class="tr"><input type="text" size="40" name="appid" id="appid" value=""/></td></tr><tr id="444"><td class="tl"><span color="f_red">cc</span></td><td class="tr"><input type="text" size="40" name="appsecret" id="appsecret" value=""/></td></tr></table></body></html><script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script><script type="text/javascript">$(function(){$("input[name=istype]").click(function(){var type=$(this).val();if(type=='1'){$("#333").hide();$("#444").hide();}else{ $("#333").show();$("#444").show();}});})</script>