title: How to mimic the anchor function in jquery
body: <p>I need some javascript that will <strong>extract an anchor ('hashtag' in the case below) from the page's url and autoscroll to the tag with that name</strong>.</p>
  
  <p>Here's an example url: www.somelink.com/post1/#hashtag</p>
  
  <p>I tried putting the url in an anchor tag like this; 
  <code>&lt;a name="hashtag" href="www.somelink.com/post1/#hashtag"&gt;</code> 
  and it works fine. But I want to mimic that functionality in code. </p>
  
  <p>I tried doing it in jQuery, but there I need to have an <code>id</code> defined. </p>
  
  <p>I searched the forum but i couldn't find what I was looking for.</p>