개발/jquery
2010-12-25
rudnine
2010. 12. 25. 23:32
반응형
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){ $("p").hide(); })})
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.
</p><button type="button">Click me</button>
</body>
</html>
위와 같이 사용한다.
버튼 누르면 P 태그에 해당하는 글을 화면에서 삭제한다.
반응형