eventPhase Event Property - Javascript DOM

Javascript examples for DOM:Event


The eventPhase event property tells which phase of the event flow is currently on.

Return Value

A Number

The number is represented by 4 constants:

Value Meaning
1CAPTURING_PHASE - in capturing phase
2 AT_TARGET - handled at the event target
3 BUBBLING_PHASE - in bubbling phase

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction(event)">Click me</button>

<input id="myInput" type="text">

function myFunction(event) {//from   w w w .  j  ava 2  s. com
    var x = event.eventPhase;
    document.getElementById("myInput").value = x;


Related Tutorials