Javascript examples for jQuery:Link
Change the location.href property dynamically through jQuery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.js"></script> <script type="text/javascript"> window.onload=function(){/*from w ww . j a va 2s . c o m*/ $('#home').attr("href" , "home.php"); } </script> </head> <body> <a id="home" href="before">Change Me</a> </body> </html>