Widely availableSupported across all major browsers. Safe to use in production.

Overview

The <input type="button"> HTML element represents a button that triggers some action, such as submitting a form or opening a dialog, styled as a labeled rectangular box by default. Not to be confused with the <button> element, which contains HTML content.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
1
18
1
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

HTML
<input type="button" value="クリック"
  onclick="alert('クリックされました')">
<!-- 推奨: <button type="button">クリック</button> -->

Live demo

button type Input

clickpossiblebutton create.button element and. comparison. with input type=button

PreviewFullscreen

Button element and. Comparison

Input type=button and button element. Difference.

PreviewFullscreen

forminside. button

submit / reset / button Compare usage. with forminside.

PreviewFullscreen

Use cases

  • Using <input type="button">

    The <input type="button"> HTML element represents a button that triggers some action, such as submitting a form or opening a dialog, styled as a labeled rectangular box by default. Not to be confused with the <button> element, which contains HTML content.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Verify how this element is announced by screen readers.

Powered by web-features