Auto click a link when page loads - Javascript jQuery

Javascript examples for jQuery:Link

Description

Auto click a link when page loads

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
  <script type="text/javascript">
    $(function(){//from   w  ww . j av  a 2 s  .  c om
$(document).ready(function () {
            $('#openApp')[0].click();
        });
    });

      </script> 
 </head> 
 <body> 
  <a href="http://www.java2s.com" id="openApp">redirect</a>  
 </body>
</html>

Related Tutorials