title: JQuery select value output value
body: <p>I wish to output the value in option in the input value field.
  So if i select red i wish to output red in the input value</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function(){
      $("select").click(function(){
          $("input:text").val($this);
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select&gt;
    &lt;option value="red"&gt;red&lt;/option&gt;
    &lt;option value="black"&gt;black&lt;/option&gt;
    &lt;option value="blue"&gt;blue&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="text" id="input" value=""&gt;
  &lt;div id="output"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>