jQuery 예제 - hide, show, toggle
<!-- 클릭시 show - hide, toggle 효과 테스트 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#hideBtn").bind("click", function(){
$("#description").hide();
});
$("#showBtn").bind("click", function(){
$("#description").show();
});
$("#chk").bind("click", function(){
$("#description").toggle();
});
});
</script>
</head>
<body>
<div id="description">
</div>
<input type="button" id="hideBtn" value="설명감추기">
<input type="button" id="showBtn" value="설명보기">
<input type="button" id="chk" value="설명보기 토글">
</body>
</html>
댓글
댓글 쓰기