title: jQuery - Replace all anchor tags with href="#" with Javascript:Void(0)
body: <p>I am trying to replace all anchor tags with href="#" and replace the value to Javascript:Void(0) instead of # across the application but the same is getting applied to all anchor tags (even the ones with links). Below is the code I am using.</p>
  
  <pre><code>$('a').attr('href', '#').each(function () {
    $(this).attr('href', 'JavaScript:Void(0)');
  });
  </code></pre>