Thursday, August 1, 2013

JavaScript – event – fire programically

JavaScript – event – fire programically


This example works on IE, Firefox, and Chrome




This example uses the mouseover - disregard the word click....


<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <input type=button id="btnTopButton" value="I am the top" onmouseover="alert('I am the top button.')">

    <br />
    <br />

    <input type=button id=Button1 value="Click on Top Button"
        onclick="javascript:TestFire();">

    <script>
        function TestFire() {           
            document.getElementById('btnTopButton').onmouseover();           
        }
    </script>
</body>
</html>

No comments:

Post a Comment