Im new to javascript. Sorry if there is anything wrong with my question.
How to inject/create/extend methods or plugins to our own library? here is "yourlib.js"
var Yourlib = (function() {
// privt. var
var selectedEl = {}
// some privt. funct
function something() {
}
return {
getById : function() {
},
setColor : function() {
}
}
}());
And below is your "plugin.js"
/*
How to create the plugin pattern?
Example: I want to create/inject a method/plugin named "setHeight" .
So, i can call it later, like this: Yourlib.getById('an-id').setHeight(value);
How is the pattern?
*/