1<input type="button" value="Clear" onclick="javascript: functionName();" >
2you just need to set the onclick event, call your desired function on this onclick event.
3
4function functionName()
5{
6 $("#output").val("");
7}
8Above function will set the value of text area to empty string.
1<textarea id='comments' rows='4' cols='4'></textarea>
2<input type="button" value="Clear" onclick="javascript:document.getElementById('comments').value='';">