How I can add functionality to a jQuery method? For example, when using hide on an element (<a> or <p> or something else):
HTML
<a href="#">click me</a>
jQuery
$("a").hide()
I tried creating a type of plugin, but I want to keep the native functionality and then add more.
jQuery.fn.extend({
hide: function () {
alert("hidden element: " + $(this));
}
});