<script> $("#pageLink").attr("href", "complexpage.html"); </script . . . <body> <a id="pageLink" href="simplepage.html">Link</a> </body>
To change the URL that a link points to, use the
.attr("href", newURL) method. When the user clicks on the link, the browser reads the
href attribute of the
<a> element and then loads that location as the next page.