'createEventObject()' Example
<html>
<body>
<script language="JavaScript">
function function1() {
var myEvent = document.createEventObject();
parent.document.all.myButton.fireEvent("onclick", myEvent);
event.cancelBubble = true;
}
function function2() {
alert('hello');
}
</script>
<button onclick="function1();">Click to see alert from</button>
<button id="myButton" onclick="function2();">Click here to see alert</button>
</body>
</html>
Related examples in the same category