title: How to use click event to fill textarea with javascript input
body: <p>I have a textarea in which people should be able to link to other topics on my site. I have 6 buttons which are <code>OnClick</code> now, but I want it easier to implement, so I want a <code>click event</code> instead of it...</p>
  
  <p>The problem is that I don't know how to do it. For example, if someone clicks on a certain button, it has to pop-up a javascript pop-up with a input field in which people can fill a URL to a website or topic. After this is filled, it has to be automatically put down on the textarea. </p>
  
  <p>How can I do this?</p>
  
  <p>This is what I have tried:</p>
  
  <pre><code>&lt;?php
  if ($verified_user) {
    echo "
  &lt;form method=post action=\"\" class=post&gt; 
  
  &lt;textarea id=\"qut\"&gt;&lt;/textarea&gt;
  
  &lt;div class=wtf&gt;
          &lt;input type=\"button\" class=\"button\" onclick=\"hen('d','--! ($language[spoil]: spoiler) !--\n\r','\n\r--! ($language[spoil] : spoiler) !--\r')\" value=\"$language[spoiler]\"  /&gt;
  &lt;/div&gt;   
  ";    }
  
  ?&gt;
  
  &lt;/div&gt;
  &lt;/textarea&gt;
  &lt;/form&gt;
  </code></pre>