Plugin example

This is a jQuery plugin example that just highlights text with the option of passing in a color

by someprimetime

HTML

<div id="test">Testing highlight</div>

JavaScript

(function($) {
    $.fn.highlight = function(options) {

        var settings = {
            'color' : null
        };
        
        if (options) {
         $.extend(settings, options); 
        }
        
        
       this.css('background-color', settings['color']);
        
        

    }     
})(jQuery);

$(function() {
    $('#test').highlight({color: 'red'}); 
});