title: trigger alert on button click with javascript
body: <p>I have two textfields with different IDs as shown</p>
  
  <pre><code>&lt;textarea id="textfield"&gt;Hello World&lt;/textarea&gt;
  </code></pre>
  
  <p>This will be updated with the content of the first textarea</p>
  
  <pre><code>&lt;input id="messageID"&gt;
  </code></pre>
  
  <p>This is my script</p>
  
  <pre><code>&lt;script type=text/javascript&gt;
  function() {
  
      var value = document.getElementById("textfield").value;
      document.getElementById('#messageID').val(value);
    alert(value);
  
  }              
  &lt;/script&gt;
  </code></pre>
  
  <p>This is the onclick button and nothing happens when I click it</p>
  
  <pre><code>&lt;button onclick="myfunction()" type="button" class="btn btn-danger" id="button"&gt;Alert&lt;/button&gt;
  </code></pre>
  
  <p>Kindly assist!</p>