如何使用jQuery效果?
要隐藏和显示div,可以使用hideandshow方法。
为了隐藏
$('#id1').hide();为了展示
$('#id1').show();示例
<html >
<head>
<title>showhide</title>
<script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#btn1').click(function () {
$('#id1').hide();
});
$('#btn2').click(function () {
$('#id1').show();
});
});
</script>
</head>
<body>
<div>
<p id="id1" style="color:red">I Am A Simple Paragraph</p>
</div>
<button type="button" id="btn1">Hide</button>
<button type="button" id="btn2">Show</button>
</body>
</html>热门推荐
10 喜得孙子祝福语简短唯美
11 婚礼祝福语简短朴实大众
12 员工周年祝福语大全简短
13 家长回复节日祝福语简短
14 简短生日祝福语老同学
15 夜雨祝福语简短10字
16 蛋糕祝福语简短闺蜜
17 部门过年祝福语简短独特
18 简短精炼的结婚祝福语