How to make an anchor tag refer to nothing?

JavascriptWeb DevelopmentFront End Technology

To make an anchor tag refer to nothing, use “javascript: void(0)”. The following link does nothing because the expression "0" has no effect in JavaScript. Here the expression "0" is evaluated, but it is not loaded back into the current document.

Example

Live Demo

<html>
   <head>
      <script>
         <!--
            //-->
      </script>
   </head>
   <body>
      <p>Click the following, This won't react at all...</p>
      <a href="javascript:void(0)">Click me!</a>
   </body>
</html> 
raja
Published on 03-Feb-2018 14:18:58
Advertisements