判断是否显示隐藏
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<title>hide</title>
<style type="text/css">
#hidden_enent{
width:200px;
height:150px;
background:#ccc;
text-align:center;
line-height:150px;
}
</style>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script> //引用你自己的jQuery
<script type="text/javascript">
$(function(){
$('#click_event').click(function(){
if($('#hidden_enent').is(':hidden')){
$('#hidden_enent').show();
$('#click_event').val('点击隐藏');
}
else{
$('#hidden_enent').hide();
$('#click_event').val('点击显示');
}
})
})
</script>
</head>
<body>
<input type="button" id="click_event" value="点击隐藏"/>
<div id="hidden_enent">蚂蚁部落欢迎您</div>
</body>
</html>