title: How to change the href for a hyperlink using jQuery:Error href is null
body: <p>I'm trying to get to the default home link(href) on my sharepoint site using jquery but i keep getting href is undefined.
  I would like to change it to another URL
  I have tried </p>
  
  <pre><code>alert($(".static selected menu-item")[0].href).text();
  
  
  
  &lt;div class="s4-lp s4-toplinks"&gt;
          &lt;div class="s4-tn" id="zz17_TopNavigationMenuV4"&gt;
              &lt;div class="menu horizontal menu-horizontal"&gt;
                  &lt;ul class="root static"&gt;
                      &lt;li class="static selected"&gt;
                      &lt;a accesskey="1" href="/sites/Home" class="static selected menu-item" style="height: 11px; margin-top: 0px;"&gt;
                      &lt;span class="additional-background"&gt;
                      &lt;span class="menu-item-text"&gt;Home&lt;/span&gt;
                      &lt;span class="ms-hidden"&gt;Currently selected&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;
                      &lt;/li&gt;
  </code></pre>
  
  <p>Any ideas what i'm doing wrong
  Thanks</p>