Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Simulating click event in Javascript or Faking Javascript click event..

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 118
    Comment on it
    <script>
    function fakeClick(event, objId) {
    var obj=document.getElementById(objId);
      if (obj.click) {
        obj.click()
      } else if(document.createEvent) {
        if(event.target !== obj) {
          var evt = document.createEvent("MouseEvents"); 
          evt.initMouseEvent("click", true, true, window, 
              0, 0, 0, 0, 0, false, false, false, false, 0, null); 
          var allowDefault = obj.dispatchEvent(evt);
          // check allowDefault for false to see event.
        }
      }
    }
    </script>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: