Wednesday, September 30, 2009

Removing Hyperlinks using jQuery

<blockquote> <html> <head> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1.3.2"); </script> <!--Author Ganesh T a.k.a Ganex. --> <script type="text/javascript"> $(document).ready(function() { //initialization code }); function disableLink(e) { e.preventDefault(); return false; } function removeLinks(){ $('.linked').bind('click', disableLink).addClass('nolink'); } function restoreLinks(){ $('.linked').unbind('click', disableLink).removeClass('nolink'); } function getTableInfo(testval){ alert(testval+" test"); } </script> <style> .nolink { text-decoration: none; color:gray; cursor:text} </style> </head> <body> <a href="javascript:getTableInfo('1');" class="linked"> Test 1 M</a> <a href="javascript:getTableInfo('2');" class="linked"> Test 2 M</a> <a href="javascript:getTableInfo('3');" class="linked"> Test 3 M</a> <a href="javascript:getTableInfo('4');" class="linked"> Test 4 M</a> <a href="javascript:getTableInfo('5');" class="linked"> Test 5 M</a> <a href="javascript:getTableInfo('6');" class="linked"> Test 6 M</a> <a href="javascript:getTableInfo('7');" class="linked"> Test 7 M</a> <input type="button" onclick="removeLinks()" name="test" value="Remove Links"/> <input type="button" onclick="restoreLinks()" name="test" value="Restore Links"/> </body> </html> </blockquote>


Showing Hiding Anchor Tags using jQuery. Remove anchor Tags Hide Anchor Tags using jquery. Anchor tag hiding Anchor Tag CSS attributes


Please check with Manuals. Author is NOT responsible for any misinformation / incorrect information or typographical errors.

NOTE: If you would like to share any useful info, please mail to the authors.

No comments:

Post a Comment

Happy Reading!

Ganex Improves .. Headline Animator