Created
April 10, 2015 07:34
-
-
Save ocmca/c9a0633bd252e0bf26f9 to your computer and use it in GitHub Desktop.
jQuery Custom Method Example From http://learn.jquery.com/plugins/basic-plugin-creation/
This file contains hidden or 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
(function( $ ) { | |
$.fn.showLinkLocation = function() { | |
this.filter( "a" ).each(function() { | |
var link = $( this ); | |
link.append( " (" + link.attr( "href" ) + ")" ); | |
}); | |
return this; | |
}; | |
}( jQuery )); // Usage example:$( "a" ).showLinkLocation(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment