Need a onclick Script

by 9 replies
12
I need a onclick script for my site, i want that when somebody click on my page a new site get open in new window.
#programming #onclick #script
  • HTML Code:
    <html>
            <head>
    	        <title>Simple OnClick Script</title>
            </head>
            <body>
                    Please click...
    
    
                    <script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script>
                    <script type="text/javascript">
    	                $("body").on("click", function() {
    		                window.open("https://kindlebookspromotion.com", "_blank");
    	                });
                    </script>
            </body>
    </html>
    • [ 2 ] Thanks
    • [1] reply
    • Yeah, that's pretty much it. I would have put the jQuery load in the html head, but that does what the OP asks.
      • [ 1 ] Thanks
      • [2] replies
  • Thanks a lot guys, its working perfectly, now i hope i will earn some extra money too.
  • xerious thanks for your valuable advice.
  • Guys, i need one improvement in this script, i wanna visitors to remain on my site,
    now what happened when visitors click on my site a new windows open and they automatically leave my site.

Next Topics on Trending Feed