Hide anchor link action, but not anchor text - Javascript jQuery

Javascript examples for jQuery:Text

Description

Hide anchor link action, but not anchor text

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){/*from w  w  w. jav a  2 s. c om*/
$("p").on("mouseover", function(){
   $("a").removeAttr("href");
});
    });

      </script> 
   </head> 
   <body> 
      <a href="http://google.com"> Link to google</a> 
      <p> Hover over me to remove the link from the anchor</p>  
   </body>
</html>

Related Tutorials