title: TypeError: .offset(...) is undefined
body: <p>can't understand whats wrong whit my code.
  Im my js:</p>
  
  <pre><code>var full_url = window.location.href;
      var parts = full_url.split("#");
      var trgt = parts[1];
      if (trgt) {
          var aTag = jQuery("a[name='" + trgt + "']");
          jQuery('html,body').animate({scrollTop: aTag.offset().top}, 'slow');
  </code></pre>
  
  <p>I get this error:</p>
  
  <p><strong>TypeError: aTag.offset(...) is undefined ...jQuery("html,body").animate({scrollTop:aTag.offset().top},"slow")}}jQuery("body"...</strong></p>
  
  <p>The url is something like this:</p>
  
  <p><a href="http://www.myurl/my-link/#backnumber" rel="nofollow noreferrer">http://www.myurl/my-link/#backnumber</a></p>
  
  <p>Im my html:</p>
  
  <pre><code>&lt;a name="backnumber"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Thanks</p>