title: Get querystring from URL using jQuery
body: <p>I have the following URL:</p>
  <pre class="lang-none prettyprint-override"><code>http://www.mysite.co.uk/?location=mylocation1
  </code></pre>
  <p>I need to get the value of <code>location</code> from the URL into a variable and then use it in jQuery code:</p>
  <pre><code>var thequerystring = &quot;getthequerystringhere&quot;
  
  $('html,body').animate({scrollTop: $(&quot;div#&quot; + thequerystring).offset().top}, 500);
  </code></pre>
  <p>How can I grab that value using JavaScript or jQuery?</p>