 <p>Just add <code>runat="server"</code> in your html code like this:</p> <pre><code>&lt;a id="topicLink" runat="server" href="default.aspx"&gt; New Topic &lt;/a&gt; </code></pre> <p>Then you can use <code>topicLink</code> to change the href value just as you did. :)</p>