title: Javascript to Jquery, add text in input onclick
body: <p>How can I change this javascript code to JQuery.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     function addTextTag(text){
      document.getElementById('text_tag_input').value += text;
     }        
  &lt;/script&gt;
  </code></pre>
  
  <p>When a user click the link text automaticaly is added in input.</p>
  
  <p>This is the HTML: </p>
  
  <pre><code>&lt;input id="text_tag_input" type="text" name="tags" /&gt;
  
  &lt;div class="tags_select"&gt;
      &lt;a href="#" onClick="addTextTag('text1, '); return false"&gt;text1&lt;/a&gt;
      &lt;a href="#" onClick="addTextTag('text2, '); return false"&gt;text2&lt;/a&gt;
      &lt;a href="#" onClick="addTextTag('text3, '); return false"&gt;text3&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the demo: <a href="http://jsfiddle.net/Smartik/j8qGT/" rel="noreferrer">http://jsfiddle.net/Smartik/j8qGT/</a></p>