Javascript examples for DOM:Event
The eventPhase event property tells which phase of the event flow is currently on.
A Number
The number is represented by 4 constants:
Value | Meaning |
---|---|
0 | NONE |
1 | CAPTURING_PHASE - in capturing phase |
2 | AT_TARGET - handled at the event target |
3 | BUBBLING_PHASE - in bubbling phase |
<!DOCTYPE html> <html> <body> <button onclick="myFunction(event)">Click me</button> <input id="myInput" type="text"> <script> function myFunction(event) {//from w w w . j ava 2 s. com var x = event.eventPhase; document.getElementById("myInput").value = x; } </script> </body> </html>