view Event Property - Javascript DOM

Javascript examples for DOM:Event


The view event property returns the Window object where the event occured.

Return Value

A String, representing the type of the event

The following code shows how to get the event view:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<p>Click the button to get the event view.</p>

<button onclick="myFunction(event)">Test</button>

<p id="demo"></p>

function myFunction(event) {/* ww  w. j  av  a 2  s .  co m*/
    var x = event.view;
    document.getElementById("demo").innerHTML = x;


Related Tutorials