首页 > 语言 > JavaScript > 正文

JQuery显示隐藏DIV的方法及代码实例

2024-05-06 14:43:07
字体:
来源:转载
供稿:网友

1. 如果在载入是隐藏:
代码如下:
<head>
<script language="javascript">
function HideWeekMonth()
{
    $("#tt1").hide();
    $("#tt2").hide();
}
</script>
</head>

<body onLoad="HideWeekMonth()">
</body>

2. 动态隐藏和显示:

代码如下:
<td>
                <!-- 能用
                <input id="btnShow" type="button" value="<?php echo $ini_array['module.insert'];?>" class="btn" />
                <input id="btnHide" type="button" value="<?php echo $ini_array['module.insert'];?>" class="btn" />
                -->
                <!-- 直接使用按钮的id没有问题
                <input id="tt" type="text" name="title" maxlength="50" size="50"></td> -->
                <input id="btnOne" type="radio" name="frequence" value="1" checked='checked'><?php echo $ini_array['time.one']?>    
                <input id="btnDay" type="radio" name="frequence" value="2"><?php echo $ini_array['time.day']?>    
                <input id="btnWeek" type="radio" name="frequence" value="3"><?php echo $ini_array['time.week']?>    
                <input id="btnMonth" type="radio" name="frequence" value="4"><?php echo $ini_array['time.month']?>    
                <br>
                <!-- 能用
                <div id="tt1"><input type="text" name="title" maxlength="50" size="50" value="tt1"></div>
                <div id="tt2"><input type="text" name="title" maxlength="50" size="50" value="tt2"></div>
                -->

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选