Jquery selector multiple href - dynamically get href value
<p>I've number of html href as shown below:</p>

<pre><code>&lt;a id="link1" href="http://www.google.com"&gt;USA &lt;/a&gt;    
&lt;a id="link2" href="http://www.google.com.au"&gt;AU &lt;/a&gt;
&lt;a id="link2" href="http://www.google.com.nz"&gt;NZ &lt;/a&gt;
</code></pre>

<p>I've jquery as below:</p>

<pre><code>&lt;script&gt;
    $("a").click(function () {
      var link = $('a').attr('href');
      alert(link);
      dosomethingforlink(link);

    });
&lt;/script&gt;
</code></pre>

<p>Basically, with one click function above I would like to get the href value of <code>&lt;a&gt;</code> tag (which is clicked) and do something different for each link.</p>

<p>Or do I need to create <code>(#id).click</code> function for each Ids?</p>

<p>Could someone please help me if the above is possible using Jquery?</p>
