title: jQuery hide and show text input
body: <p>I want to do a simple function in Jquery: when a button is clicked show the input text, when it's clicked again- hide the input text.</p>
  
  <pre><code>&lt;div&gt;
    &lt;div id="btnNewGroup"&gt;New Group&lt;/div&gt;
    &lt;input type="text" id="newGroup" style="display:none" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and this is the scrupt section:</p>
  
  <pre><code>$(document).ready(function () {
    $("#btnNewGroup").click(function () {
       if ($("#newGroup").hide()) {
             $("#newGroup").show();
       }
  
       else {
             $("#newGroup").hide()
       }
    });
  });
  </code></pre>
  
  <p>when I click the button the text input is showing, when I click it again I want the input text to be hidden, but nothing happens.</p>