change text decoration css using jquery

<head>
<script type="text/javascript" src="jquery-1.7.21.7.2.js">
</script>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready(function(){
  $("#mylink").mouseover(function(){
    $(this).css("textDecoration", "underline");
  });
  $("#mylink").mouseout(function(){
    $(this).css("textDecoration", "none");
  });
});
/* ]]> */
</script>
</head>
<body>
<p><a id="mylink" href="http://w3mentor.com" style="text-decoration: none">
w3mentor.com</a></p>
</body>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.