jQuery 클릭 이벤트

Jmnote (토론 | 기여)님의 2014년 11월 27일 (목) 11:47 판

jQuery 클릭 이벤트

1 예시

  • 브라우저에서 문서를 모두 읽어들인 후에(ready), 모든 p 태그의 클릭 이벤트(click)에 숨김기능(hide)을 넣었다.
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p>클릭하면 사라집니다 1</p>
<p>클릭하면 사라집니다 2</p>
</body>
</html>

2 같이 보기

3 참고자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}