본문 바로가기
개발/jquery

2011-1-1

by rudnine 2011. 1. 1.
반응형
* find() 메서드
- DOM 요소 집합내에서 자식노드를 찾기위한 방법이라 함.
예를 들면, <p> 태그 내에서 <em> 요소만을 찾아내거나할때 사용 가능함.

ex)

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>eventDiary</title>
</head>
 
<body>
<p>abcd<em>bb</em>adsf</p>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript">



alert("cont == " + jQuery('p').find('em').length);

</script>
</body>
</html>



반응형

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

2011-01-13, [1.5 DOM요소의 래퍼 집합 필터링하기 실습]  (0) 2011.01.13
2011-01-04  (0) 2011.01.04
jQuery 관련링크모음  (0) 2010.12.30
2010-12-28  (0) 2010.12.29
2010-12-26  (0) 2010.12.26

댓글