title: get value out of jquery plugin
body: <p>How do you get the value set in this plugin out again? </p>
  
  <p>Example below shows a variable I want available on the page anywhere I need to call it. put all I get is undefined?</p>
  
  <p><strong>plugin.js</strong></p>
  
  <pre><code>(function($) {
      $.fn.myPlugin = function(options) {
          options.val ++;
          // access and modify 'somevar' here so that it gets modified
          // in the function which called a plugin
  
      };
  })(jQuery);
  </code></pre>
  
  <p><strong>script on page</strong></p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function(){
          var somevar = {val: 5};
          $(document).myPlugin(somevar);
      });
  &lt;/script&gt;
  
  &lt;script&gt;
      $(document).ready(function(){
          alert(somevar.val);
      });
  &lt;/script&gt;
  </code></pre>