event.target
설명 : 이벤트를 시작한 DOM 요소입니다.
이 target속성은 이벤트 또는 그 이벤트의 자손에 대해 등록 된 요소가 될 수 있습니다. 이벤트 버블 링으로 인해 이벤트가 처리되고 있는지를 판별하기 위해 를 비교 event.target하는 것이 종종 유용합니다 this. 이 속성은 이벤트 위임에 매우 유용합니다.
예 :
클릭시 태그 이름 표시
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>event.target demo</title>
<style>
span, strong, p {
padding: 8px;
display: block;
border: 1px solid #999;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div id="log"></div>
<div>
<p>
<strong><span>click</span></strong>
</p>
</div>
<script>
$( "body" ).click(function( event ) {
$( "#log" ).html( "clicked: " + event.target.nodeName );
});
</script>
</body>
</html>
게시글 목록
| 번호 | 제목 |
|---|---|
| 15854 |
jQuery
deferred.catch( failFilter )
|
| 15853 | |
| 15852 |
jQuery
.dblclick (handler)
|
| 15851 |
jQuery
제이쿼리 .data()
|
| 15849 |
jQuery
.css (propertyName)
|
| 15848 |
jQuery
.contextmenu( handler )
|
| 15847 |
jQuery
.contents()
|
| 15843 | |
| 15842 | |
| 15841 |
jQuery
.closest (selector)
|
| 15840 | |
| 15839 |
jQuery
제이쿼리 .click( handler )
|
| 15838 | |
| 15837 |
jQuery
제이쿼리 jQuery( ".class" )
|
| 15836 |
jQuery
제이쿼리 .children ([selector])
|
| 15835 |
jQuery
제이쿼리 jQuery ( ": checkbox")
|
| 15834 |
jQuery
제이쿼리 .change( handler )
|
| 15833 | |
| 15832 |
jQuery
제이쿼리 callbacks.locked ()
|
| 15831 |
jQuery
제이쿼리 callbacks.lock()
|
| 15830 | |
| 15829 | |
| 15828 |
jQuery
제이쿼리 callbacks.fired()
|
| 15826 | |
| 15825 | |
| 15824 |
jQuery
제이쿼리 callbacks.empty()
|
| 15823 |
PHP
rsa 암호화 클래스
|
| 15822 |
jQuery
제이쿼리 callbacks.disable ()
|
| 15821 | |
| 15820 |
jQuery
제이쿼리 .blur( handler )
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기