title: javascript:void(0) in jquery
body: <p>I have an jsp page with html and js like below. Now I want to keep the js function test() to another js file. I m trying to write that using jquery.</p>
  
  <pre><code>&lt;div class="class1"&gt;
  &lt;a href="javascript:void(0)" onclick="test();" id="add_another" &gt;&lt;b&gt;Add another user&lt;/b&gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS function</p>
  
  <pre><code>function test(){
      alert("I am here");
      //other code
   }
  </code></pre>
  
  <p>I tried to write like this</p>
  
  <pre><code>$(function() {
       $('#add_another').click(test);
  });
  </code></pre>
  
  <p>But its not working. I am not sure if its because its having href="javascript:void(0)"
  When the user clicks Add Another User link, it show display another div. That is the test() doing. But the alert itself is not coming.
  Can somebody please help me in this?</p>