-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: "HTMLButtonElement: type プロパティ" | ||
short-title: type | ||
slug: Web/API/HTMLButtonElement/type | ||
l10n: | ||
sourceCommit: 34d914d848c6d749bb264e6d5c4dda3e94fda4ba | ||
--- | ||
|
||
{{ApiRef("HTML DOM")}} | ||
|
||
**`type`** は {{domxref("HTMLButtonElement")}} インターフェイスのメソッドで、この {{HTMLElement("button")}} 要素の動作の種類を示す文字列です。 | ||
|
||
これは {{HTMLElement("button")}} 要素の [`type`](/ja/docs/Web/HTML/Element/button#type) 属性を反映しています。 | ||
|
||
## 値 | ||
|
||
種類を表す文字列です。 | ||
|
||
取りうる値は[ボタンの種類](/ja/docs/Web/API/HTMLButtonElement#htmlbuttonelement.type)の節に一覧があります。 | ||
|
||
## 例 | ||
|
||
### HTML | ||
|
||
```html | ||
<button id="button" type="reset">type</button> | ||
``` | ||
|
||
### JavaScript | ||
|
||
```js | ||
const buttonElement = document.querySelector("#buttton"); | ||
console.log(buttonElement.type); // "reset" | ||
``` | ||
|
||
## 仕様書 | ||
|
||
{{Specifications}} | ||
|
||
## ブラウザーの互換性 | ||
|
||
{{Compat}} | ||
|
||
## 関連情報 | ||
|
||
- {{domxref("HTMLTextAreaElement.type")}} プロパティ | ||
- {{domxref("HTMLInputElement.type")}} プロパティ |