title: get href onclick and redirect with link
body: <p>I am trying to do below code for redirect from one page to other page with that particular 'a' tag click and appended with that particular link which is in clk variable</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function abc()
  {
   
  var a = document.getElementsByTagName("a");
  //alert(a);
      for (var i = 0; i &lt; a.length; i++) {
         a[i].onclick = function (e) {
         e.preventDefault();
    var clk=$(this).attr('href');
    window.location='http://www.shopeeon.com?ver='+clk;
         //doSomething();
      }
  }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a  id="first" onclick='abc();' href="http://www.google.com" &gt;Google&lt;/a&gt;&lt;br/&gt;
  &lt;a  id="second" onclick='abc();' href="http://www.yahoo.com" &gt;Yahoo&lt;/a&gt;&lt;br/&gt;
  &lt;a  id="third" onclick='abc();' href="http://www.rediff.com" &gt;Rediff&lt;/a&gt;&lt;br/&gt;
  &lt;a  id="third" onclick='abc();' href="http://www.gmail.com" &gt;Gmail&lt;/a&gt;&lt;br/&gt;
  &lt;a  id="third" onclick='abc();' href="http://www.facebook.com" &gt;Facebook&lt;/a&gt;&lt;br/&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The above code is not work properly that i want</p>
  
  <p>e.g. suppose when i click on first link(or may be some other) then on that particular click i get href of that link and store in clk variable and also redirect to other page with that particular link.</p>