Khi một biểu mẫu được đặt lại, cài đặt lại trình kích hoạt thuộc tính. Bạn có thể thử chạy mã sau để triển khai onreset thuộc tính -
Ví dụ
<!DOCTYPE html>
<html>
<body>
<form onreset = "display()">
Student Name:<br>
<input type = "text" name = "sname">
<br>
Student Subject:<br>
<input type = "text" name = "ssubject">
<br>
<input type = "reset" value = "reset">
</form>
<script>
function display() {
alert("Form reset successfull!");
}
</script>
</body>
</html>