본문 바로가기
개발/jquery

2010-12-25

by rudnine 2010. 12. 25.
반응형

<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">
$(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 태그에 해당하는 글을 화면에서 삭제한다.

반응형

'개발 > jquery' 카테고리의 다른 글

jQuery 관련링크모음  (0) 2010.12.30
2010-12-28  (0) 2010.12.29
2010-12-26  (0) 2010.12.26
jQuery Attribute Selectors  (0) 2010.12.22
jquery 1  (0) 2010.12.20

댓글