title: toggle text area on button click
body: <p>I want to enable the text area, when I click the toggle button. Once the comments are saved from the text area, it has to hide and return to the old position. Since I'm a newbie, struggling a little. Thanks in advance :-)</p>
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
     &lt;body&gt;
        &lt;textarea class=&quot;ipText&quot; name=&quot;myTextBox&quot; id=&quot;txtBox&quot; cols=&quot;50&quot; rows=&quot;5&quot;&gt;&lt;/textarea&gt;
        &lt;/br&gt;
        &lt;button type=&quot;submit&quot; onclick=&quot;saveComment()&quot;&gt;Save&lt;/button&gt;
        &lt;input type=&quot;button&quot; name=&quot;enableText&quot; id=&quot;enableTxt&quot; value=&quot;Click to Toggle&quot; onclick=&quot;toggleText();&quot;&gt;
        &lt;script type =&quot;text/javascript&quot;&gt;
           function toggleText(txt) {
              document.getElementById(&quot;txtBox&quot;).disabled = !txt.clicked;
           }
        &lt;/script&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>EDIT: here is the jfiddle link. <a href="http://jsfiddle.net/suP8z/5/" rel="nofollow noreferrer">http://jsfiddle.net/suP8z/5/</a></p>