And so on You may well have a preference for one of these approaches, but it is another potentially useful pattern to be aware of 174 | Chapter 14: Bonus: jQuery Plugin DesignPatterns www.it-ebooks.info /* * 'Highly configurable' mutable plugin boilerplate * Author: @markdalgleish * Further changes, comments: @addyosmani * Licensed under the MIT license */ // Note that with this pattern, as per Alex Sexton's, the plugin logic // hasn't been nested in a jQuery plugin Instead, we just use // jQuery for its instantiation ;(function( $, window, document, undefined ){ // our plugin constructor var Plugin = function( elem, options ){ this.elem = elem; this.$elem = $(elem); this.options = options; // This next line takes advantage of HTML5 data attributes // to support customization of the plugin on a per-element // basis For example, //