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 :-)
<html>
<body>
<textarea class="ipText" name="myTextBox" id="txtBox" cols="50" rows="5"></textarea>
</br>
<button type="submit" onclick="saveComment()">Save</button>
<input type="button" name="enableText" id="enableTxt" value="Click to Toggle" onclick="toggleText();">
<script type ="text/javascript">
function toggleText(txt) {
document.getElementById("txtBox").disabled = !txt.clicked;
}
</script>
</body>
</html>
EDIT: here is the jfiddle link. http://jsfiddle.net/suP8z/5/