用法:
对象.hide();
例子:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
<script type="text/javascript" src="jquery-core/jquery-1.8.0.js"></script>
<script type="text/javascript">
//使用hide函数可以隐藏对应的元素
$(function(){
$('#btn').click(function(){
$('#div1').hide();
});
});
</script>
</head>
<body>
<div id="div1">这是一个div</div>
<input type="button" id="btn" value="按下" />
</body>
</html>
对象.hide();
例子:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
<script type="text/javascript" src="jquery-core/jquery-1.8.0.js"></script>
<script type="text/javascript">
//使用hide函数可以隐藏对应的元素
$(function(){
$('#btn').click(function(){
$('#div1').hide();
});
});
</script>
</head>
<body>
<div id="div1">这是一个div</div>
<input type="button" id="btn" value="按下" />
</body>
</html>