JavaScript 中 onreset 事件有什麼用途?
當表單重置時,onreset 事件很有用。您可以嘗試執行以下程式碼來了解如何在 JavaScript 中實現onreset 事件 -
示例
<!DOCTYPE html>
<html>
<body>
<script>
function resetFunct() {
alert("The form was reset");
}
</script>
<form onreset = "resetFunct()">
Enter age: <input type = "number"><br>
Enter birth month: <input type = "text"><br>
<input type = "reset">
</form>
</body>
</html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP