Created
July 13, 2012 23:34
-
-
Save chrisdigital/3108231 to your computer and use it in GitHub Desktop.
Deactivate all links and remove onclick events with JQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
// On document ready.... | |
// Needs JQuery and possibly JQuery UI | |
//-----deactivate links------// | |
$("a").click(function(event) { | |
event.preventDefault(); | |
//alert("test, I'm working! I deactivated all links."); | |
}); | |
//$("a").removeAttr("onclick"); | |
//deativate onclick events on h3 navigation headers | |
$("h3").removeAttr("onclick"); | |
//-----end deactivate links------// | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment