Plugin Base (Default Structure)

by D S

HTML

<div id="item1"></div>
<div id="item2"></div>

JavaScript

/**
 * Created by Dan on 29/03/2017.
 */
$.fn.MusicPlayer = function(options) {
  var settings = $.extend({
    // These are the defaults
    title: ""
  }, options);
  var thisObj;
  thisObj = this;



  thisObj.each(function() {
    console.log(settings.title);
  });
};

// In BODY 
$("#item1").MusicPlayer({
  title: "danial"
});
$("#item2").MusicPlayer({
  title: "doryana"
});