GlobalEventHandlers.onpointerenter

GlobalEventHandlers mixin의 onpointerenter property는 pointerenter 이벤트를 처리하는 EventHandler (en-US) 이다.

Syntax

targetElement.onpointerenter = enterHandler;

var enterHandler = targetElement.onpointerenter;

Value

enterHandler
The pointerenter event handler for element targetElement.

Example

아래 예제는 element의 pointerenter 이벤트 핸들러를 설정하는 onpointerenter 의 2가지 사용법을 보여준다.

<html>
<script>
function enterHandler(ev) {
  // pointerenter event처리
}
function init() {
  let el = document.getElementById('target1');
  el.onpointerenter = enterHandler;
}
</script>

<body onload="init();">
  <div id="target1"> Touch me ... </div>
  <div id="target2" onpointerenter="enterHandler(event)"> Touch me ... </div>
</body>
</html>

Specifications

Specification Status Comment
Pointer Events – Level 2
The definition of 'onpointerenter' in that specification.
Recommendation Non-stable version
Pointer Events
The definition of 'onpointerenter' in that specification.
Obsolete Initial definition

Browser compatibility

BCD tables only load in the browser

See also