title: how to pass dropdown selected value in jquery plugin
body: <p>I need to pass the dropdown selected value to the jQuery plugin.</p>
  
  <h3>HTML:</h3> 
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="jquery.requiredplugin.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;select name="Type" id="sid"&gt;
        &lt;option value="value1"&gt;value1&lt;/option&gt;
        &lt;option value="value2" selected&gt;value2&lt;/option&gt;
        &lt;option value="value3"&gt;value3&lt;/option&gt;
      &lt;/select&gt;
      &lt;textarea name="source" id="src1" cols="150" rows="20"&gt;&lt;/textarea&gt;
      &lt;script type="text/javascript"&gt;
        $("#src1").keyup(function(e) {
          $(this).pluginmethod(e.keycode);
        });
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h3>jquery.requiredplugin.js:</h3>
  
  <pre><code>(function ($) {
    // jQuery plugin definition
    $.fn.pluginmethod = function (keycode) {
      return this.each(function () {
        var $str = $('#src1');
        var $soml = $('#sid');
        var somlan = $soml.val(); //if I assign  var somlan with some static value my code works
        var som = $str.val();
        /* My code goes here where I use both var som and  var somlan*/
      });
    };
  })(jQuery);
  </code></pre>
  
  <p>I am able to get the value of <code>$('#src1')</code> and if assign  <code>var somlan</code> with some static value then my code works. But if I want to use dropdown selected value(whose id is <code>"sid"</code> ) and retrieve the value in the plugin as <code>var $soml = $('#sid');</code> then my code doesn't work.</p>
  
  <p>How can I use dropdown selected value in my plugin?</p>