เมื่อแบบฟอร์มถูกรีเซ็ต onreset ทริกเกอร์แอตทริบิวต์ คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้งาน onreset แอตทริบิวต์ −
ตัวอย่าง
<!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>