如何使用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 感谢学长学姐祝福语简短
16 戏精的祝福语简短
17 我要结婚祝福语简短
18 婚前女儿生日祝福语简短