title: Jquery force enter press when using the .click function
body: <p>Hey guys i've been reading and trying and can't make this damn code to work..</p>
  
  <p>so basically the code below is my whole file.</p>
  
  <p>The code does this:When i click on <code>Bus</code> ,<code>Bus</code> gets copied to the <code>input field</code> than it focuses on the <code>input field</code>,and here is my issue,when it gets copied it does not want to press enter,how do i force an enter press when i click on Bus or Car? any ideas</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"&gt;&lt;/script&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;script&gt;
     function changeValue(o){
       document.getElementById('type').value=o.innerHTML;
       $('.text_stuff').click(function() {
           $('#type').focus();
      });
      }
      $('.text_stuff').click(function() {
           $('#type').trigger(jQuery.Event('keypress', {keyCode: 13}));
           });
  &lt;/script&gt;
  &lt;p class="text_stuff" id="technician" onclick="changeValue(this)"&gt;Car&lt;/p&gt;
  &lt;p class="text_stuff" id="developer" onclick="changeValue(this)"&gt;Bus&lt;/p&gt;
  
  &lt;input id="type" type="text" name="" value=""&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks in advance</p>