title: Jquery div to textbox onclick and back to div
body: <p>If you have been on the new PHP myadmin you can click on a field and edit it then when you click away it changes back to a div, I thought this could be found on the web easy but aprently not, so I tryed to make it and I'm not very good with javascript so I failed.
  Heres what i got so far.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;td id="td_1"&gt;&lt;input type="hidden" value="0" /&gt;0&lt;/td&gt;
  </code></pre>
  
  <p>Javascipt:</p>
  
  <pre><code>$("#td_1").click(function() {
      $input = $("#td_1");
      $field = $('&lt;input type="text" id="txt_1" maxlength="1" size="1"/&gt;').attr({
          id: $input.id,
          name: $input.name,
          value: $input.val()
      });
      $input.after($field).remove();
  });
  </code></pre>
  
  <p>It adds the textbox but does not add the value to it, and stuck on how to change it back</p>
  
  <p>Thanks for any help :)</p>