最終更新:2026-09-12
<button>BUTTON 要素
<button> 要素はクリック可能なボタンを作成します。<input type="button"> と違い、テキスト・アイコン・画像など任意のHTMLを含められます。既定の type は submit です。
| カテゴリ | フォーム |
|---|---|
| コンテンツモデル | フレージングコンテンツ(対話型コンテンツは不可) |
| 許可される親要素 | フレージングコンテンツを受け入れる要素 |
| 閉じタグ | 必要 </button> タグ |
| ステータス | 標準 |
📝 構文
<button type="button">ボタンのテキスト</button>
⚙️ 属性
この要素はグローバル属性に加え、以下の属性をサポートします:
| 属性 | 値 | 説明 |
|---|---|---|
type | Keyword | The behavior type of the button.
|
name | Text | Button name, submitted with the form. |
value | Text | The value submitted with the button. |
disabled | Boolean | Disables the button. |
form | Form ID | Associates the button with a form (can be outside it). |
▶ サンプル
下のコードを編集して、playground でリアルタイム結果を確認:
🌐 ブラウザサポート
| ブラウザ | |||||
|---|---|---|---|---|---|
| <button> | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| すべての主要ブラウザでサポート | |||||
ヒント: フォーム外のボタンには type="button" を指定しましょう。指定しないとクリック時に予期せず送信されることがあります。