Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add document for HTMLButtonElement.type #32024

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
Document for HTMLButtonElement.type
  • Loading branch information
ShubhamOulkar committed Jan 31, 2024
commit 6c2bd7032fb14adebb25fa5c17567996de323003
47 changes: 47 additions & 0 deletions files/en-us/web/api/htmlbuttonelement/type/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: "HTMLButtonElement: type property"
short-title: type
slug: Web/API/HTMLButtonElement/type
page-type: web-api-instance-property
browser-compat: api.HTMLButtonElement.type
---

{{ApiRef("HTML DOM")}}

The **`type`** property of the {{domxref("HTMLButtonElement")}} interface is a string that indicates behaviour type of the {{HTMLElement("button")}} element.

It reflects the [`type`](/en-US/docs/Web/HTML/Element/button#type) attribute of the {{HTMLElement("button")}} element.

## Value

A string representing the type.

Its possible values are listed in the attribute's [buttom types](/en-US/docs/Web/API/HTMLButtonElement#htmlbuttonelement.type) section.
ShubhamOulkar marked this conversation as resolved.
Show resolved Hide resolved

## Example

### HTML

```html
<button id="button" type="reset">type</button>
```

### JavaScript

```js
const buttonElement = document.querySelector("#buttton");
console.log(buttonElement.type); // Output: "reset"
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLTextAreaElement.type")}} property.
ShubhamOulkar marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("HTMLInputElement.type")}} property