We would like to know how to handle form submit event.
<html>
<body>
<script language="JavaScript">
function confirm(){<!-- ww w . j a va2s.com-->
console.log("Your comments have been submitted. Thank you.");
}
</script>
<form name="form1" onSubmit = 'confirm()'
<b>Enter Comments:</b>
<br>
<textarea name="comments" rows="5" cols="60"></textarea>
<br><br>
<input type = "submit" Value="Submit Comments">
</form>
</body>
</html>
The code above is rendered as follows: