title: What is the recommended way of attaching JavaScript to a link
body: <p>Here's my sample code..</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function(){ 
  $("a.change").click(function(){  
  $("a.change").hide();
  $("div#change").append("&lt;a href=''&gt;Hello world!&lt;/a&gt;&lt;a href=''&gt;lounge&lt;/a&gt;");
  });
  });
  &lt;/script&gt;
  &lt;div id="change"&gt;
  &lt;a href="javascript:;" class="change" name="change"&gt;Change Vote&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The code works great..but i read in various forums about using "href=javascript:;" as inconsistent and outdated! Is that true? If yes, then how do I overcome this obsoleteness?</p>