HTMLonresetイベント属性

❮HTMLイベント属性

フォームの[リセット]ボタンがクリックされたときにJavaScriptを実行します。

<form onreset="myFunction()">
  Enter name: <input type="text">
  <input type="reset">
</form>

定義と使用法

onreset属性は、フォームがリセットされたときに発生します。


ブラウザのサポート

Event Attribute
onreset Yes Yes Yes Yes Yes

構文

<element onreset="script">

属性値

Value Description
script The script to be run on onreset

技術的な詳細

サポートされているHTMLタグ: <フォーム>

関連ページ

HTML DOMリファレンス:onresetイベント


❮HTMLイベント属性