< form>Execution:
Enter a name< br />
< input id="text" />
< input type="button" value="Validate" />
< h3 id="res">
< script>
document.onclick= function(event) {
// the event is used to detect which component the click went to
if (event===undefined) event= window.event;
var target= 'target' in event? event.target: event.srcElement;
document.getElementById("res").innerHTML = "I clicked on an element of type "+target.tagName;
};
Please disable your ad blocker and refresh the window to use this website.