개발/jquery
2011-1-1
rudnine
2011. 1. 1. 09:33
반응형
* 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>
반응형