--- title: GlobalEventHandlers.onpointerenter slug: Web/API/GlobalEventHandlers/onpointerenter translation_of: Web/API/GlobalEventHandlers/onpointerenter ---
{{ApiRef("HTML DOM")}}

{{domxref("GlobalEventHandlers")}} mixin의 onpointerenter property는 {{event("pointerenter")}} 이벤트를 처리하는 {{domxref("EventHandler")}} 이다.

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
{{SpecName('Pointer Events 2','#dom-globaleventhandlers-onpointerenter', 'onpointerenter')}} {{Spec2('Pointer Events 2')}} Non-stable version
{{SpecName('Pointer Events', '#widl-GlobalEventHandlers-onpointerenter', 'onpointerenter')}} {{Spec2('Pointer Events')}} Initial definition

Browser compatibility

{{Compat("api.GlobalEventHandlers.onpointerenter")}}

See also