title: jquery attr('href') not working
body: <p>Update, problem solved. The issue was with a function that I was calling after trying to change the HREF, which was essentially changing it back.</p>
  
  <hr>
  
  <p>Using jQuery, I am trying to change the HREF attribute of a series of links based on the hash contained in the URL, but the attribute simply is not changing, it's being changed to an empty string.</p>
  
  <p>Can anyone see what I'm doing wrong here? Why isn't it working?</p>
  
  <p><a href="http://fwy.pagodabox.com/categories/sculptures/#grid" rel="nofollow">http://fwy.pagodabox.com/categories/sculptures/#grid</a></p>
  
  <p>The links in question are</p>
  
  <blockquote>
    <p>All
        Exhibitions
        Installations
        Objects
        Prints
        Sculptures</p>
  </blockquote>
  
  <p>In the secondary nav</p>
  
  <pre><code>function navHash($navlinks, hashtxt) {
  
          // loop through specified links
          $navlinks.each(function(){
              var $me = $j(this),
                  myhref,
                  index;
  
              // Does this link have an href… if not move on          
              if( typeof $me.attr('href') === "undefined" )
                  return false;
  
              myhref = $me.attr('href');
          index = myhref.indexOf('#');
  
          // if my href doesn't have the specified hash text, add it, else remove it
          if(myhref.indexOf(hashtxt) === -1) {
              $me.attr("href", hashtxt);
          } else {
              $me.attr("href", myhref.substring(0, index));
          }   
      });
  }
  
  
  
  
     $j(document).ready(function($){
  
          var $navlinks = $j('.sub-nav li:not(.views) a');
  
          if(window.location.hash == '#grid') {
              navHash($navlinks, '#grid');
              $('.views .ic-grid').click();
          }
  // so on...
  </code></pre>
  
  <p>Thank you!!!</p>