title: Javascript module pattern: How to inject/create/extend methods/plugin to our own library?
body: <p>Im new to javascript. Sorry if there is anything wrong with my question.</p>
  
  <p>How to inject/create/extend methods or plugins to our own library?
  here is "yourlib.js"</p>
  
  <pre><code>var Yourlib = (function() {
      // privt. var
      var selectedEl = {}
  
      // some privt. funct
      function something() {
  
      }
  
      return {
          getById : function() {
  
          },
          setColor : function() {
  
          }
      }
  }());
  </code></pre>
  
  <p>And below is your "plugin.js"</p>
  
  <pre><code>/*
  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?
  */
  </code></pre>