title: How to highlight a link in Javascript
body: <p>I have a search box on my page. When it is submitted it will jump to the anchor id further down the page based on the id entered into the text box, without refreshing the page (this is key).</p>
  
  <p>Here is my current code.</p>
  
  <p>Javascript:</p>
  
  <pre><code>$(function() {
      $('form#unitid_quickfind').submit(function(e) {
          var anchor = $("#unitid_input").val();
          var position = $("#"+anchor).offset();
          window.scrollTo(position.left, position.top);
  
          return false;
      });
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form id="unitid_quickfind"&gt;
      &lt;input id="unitid_input" type="text" /&gt;
      &lt;input type="submit" value="Find" /&gt;
  &lt;/form&gt;
  
  &lt;a id="1"&gt;Unit 1&lt;/a&gt;
  &lt;a id="2"&gt;Unit 2&lt;/a&gt;
  &lt;a id="3"&gt;Unit 3&lt;/a&gt;
  </code></pre>
  
  <p>Alongside jumping to the anchor when the submit is clicked, I would also like the link highlighted in some way. What is the easiest way to achieve this (preferably adding to the existing Javascript function)?</p>
  
  <p>TIA</p>