Check the below onclick even handler to the textarea opening tag if you want to do it that way:
Code:
<textarea onclick="this.value=''; ">
Also, if you want to clear the textarea then you can click on a seperate button like the below html code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function cleatTextAtea() {
document.getElementById("txtArea").value='';
}
</script>
</head>
<body>
<textarea id="txtArea" cols="40" rows="5">Enter text here....</textarea>
<button onclick="cleatTextAtea();">Clear Textarea</button>
</body>
</html>
Bookmarks