您的位置:首页 > 编程语言 > PHP开发

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

2013-09-11 18:11 531 查看
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  php
相关文章推荐