title: How to get value from onclick() Button to input jquery
body: <p>I am trying to create a <code>color picker</code>, whenever i click on a colored button, the respective color name gets sent to the input automatically; if i click on white button i get in input : White and so on ...
  Here is my code so far:</p>
  
  <p><strong>HTML</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function changewhite() {
      document.getElementById("color").innerHTML="White";
  }
  function changeblack() {
      document.getElementById("color").innerHTML="Black";
  }
  function changered() {
      document.getElementById("color").innerHTML="Red";
  }
  function changeblue() {
      document.getElementById("color").innerHTML="Blue";
  }
  function changeyellow() {
      document.getElementById("color").innerHTML="Yellow";
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;label&gt;Color:&lt;/label&gt;
  
  &lt;td width="314"&gt;&lt;input name="white" type="button" id="white" onclick="changewhite()" value="" width="20px" /&gt;
  &lt;input name="black" type="button" id="black" onclick="changeblack()" value="" width="20px" /&gt;
  &lt;input name="red" type="button" id="red" onclick="changered()" value="" width="20px" /&gt;
  &lt;input name="blue" type="button" id="blue" onclick="changeblue()" value="" width="20px" /&gt;
  &lt;input name="yellow" type="button" id="yellow" onclick="changeyellow()" value="" width="20px" /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>NB:
  I would like to add that before using an input to get the color, i was using <code>&lt;p id="color"&gt; &lt;/p&gt;</code>, the code was working perfectly, but don't know why with an input it didnt work.</p>