Writing a Plugin
Extend $.fn to add methods.
Example
$.fn.highlight = function (color) {
return this.css("background", color || "yellow");
};
$("p").highlight("pink");Exercise
Extend.
$..highlight = fn
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.