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

New pages: HTML<formelement>Element.name #35628

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions files/en-us/web/api/htmlbuttonelement/name/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "HTMLButtonElement: name property"
short-title: name
slug: Web/API/HTMLButtonElement/name
page-type: web-api-instance-property
browser-compat: api.HTMLButtonElement.name
---

{{ApiRef("HTML DOM")}}

The **`name`** property of the {{domxref("HTMLButtonElement")}} interface indicates the name of the {{HTMLElement("button")}} element or the empty string if the element has no name. It reflects the element's [`name`](/en-US/docs/Web/HTML/Element/button#name) attribute.

## Value

A string representing the element's name.

## Example

```js
const buttonElement = document.querySelector("#myButton");
console.log(`Element's name: ${buttonElement.name}`);
buttonElement.name = "newName";
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLButtonElement.value")}}
- {{domxref("HTMLButtonElement.type")}}
41 changes: 41 additions & 0 deletions files/en-us/web/api/htmlfieldsetelement/name/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: "HTMLFieldSetElement: name property"
short-title: name
slug: Web/API/HTMLFieldSetElement/name
page-type: web-api-instance-property
browser-compat: api.HTMLFieldSetElement.name
---

{{ApiRef("HTML DOM")}}

The **`name`** property of the {{domxref("HTMLFieldSetElement")}} interface indicates the name of the {{HTMLElement("fieldset")}} element. It reflects the element's [`name`](/en-US/docs/Web/HTML/Element/fieldset#name) attribute.

## Value

A string representing the element's name.

## Example

```js
const fs = document.querySelector("fieldset");
console.log(`Element's name: ${fs.name}`);
fs.name = "billing"; // sets or updates the element's name
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLFieldSetElement.elements")}}
- {{domxref("HTMLFieldSetElement.disabled")}}
- {{domxref("HTMLLegendElement")}}
- {{domxref("HTMLFormElement")}}
- {{HTMLElement("fieldset")}}
- {{HTMLElement("legend")}}
- {{HTMLElement("form")}}
37 changes: 37 additions & 0 deletions files/en-us/web/api/htmloutputelement/name/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "HTMLOutputElement: name property"
short-title: name
slug: Web/API/HTMLOutputElement/name
page-type: web-api-instance-property
browser-compat: api.HTMLOutputElement.name
---

{{ApiRef("HTML DOM")}}

The **`name`** property of the {{domxref("HTMLOutputElement")}} interface indicates the name of the {{HTMLElement("output")}} element. It reflects the element's [`name`](/en-US/docs/Web/HTML/Element/output#name) attribute.

## Value

A string representing the element's name.

## Example

```js
const outputElement = document.querySelector("#log");
console.log(`Element's name: ${outputElement.name}`);
outputElement.name = "sum"; // sets or updates the element's name
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLOutputElement.defaultValue")}}
- {{domxref("HTMLOutputElement.htmlFor")}}
- {{domxref("HTMLOutputElement.labels")}}
37 changes: 37 additions & 0 deletions files/en-us/web/api/htmlselectelement/name/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "HTMLSelectElement: name property"
short-title: name
slug: Web/API/HTMLSelectElement/name
page-type: web-api-instance-property
browser-compat: api.HTMLSelectElement.name
---

{{ApiRef("HTML DOM")}}

The **`name`** property of the {{domxref("HTMLSelectElement")}} interface indicates the name of the {{HTMLElement("select")}} element. It reflects the element's [`name`](/en-US/docs/Web/HTML/Element/select#name) attribute.

## Value

A string representing the element's name.

## Example

```js
const selectElement = document.querySelector("#planets");
console.log(`Element's name: ${selectElement.name}`);
selectElement.name = "galaxies"; // sets or updates the element's name
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLSelectElement.value")}}
- {{domxref("HTMLSelectElement.selectedIndex")}}
- {{domxref("HTMLSelectElement.options")}}
36 changes: 36 additions & 0 deletions files/en-us/web/api/htmltextareaelement/name/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "HTMLTextAreaElement: name property"
short-title: name
slug: Web/API/HTMLTextAreaElement/name
page-type: web-api-instance-property
browser-compat: api.HTMLTextAreaElement.name
---

{{ApiRef("HTML DOM")}}

The **`name`** property of the {{domxref("HTMLTextAreaElement")}} interface indicates the name of the {{HTMLElement("textarea")}} element. It reflects the element's [`name`](/en-US/docs/Web/HTML/Element/textarea#name) attribute.

## Value

A string representing the element's name.

## Example

```js
const textareaElement = document.querySelector("#message");
console.log(`Element's name: ${textareaElement.name}`);
textareaElement.name = "response"; // sets or updates the element's name
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLTextAreaElement.value")}}
- {{domxref("HTMLTextAreaElement.textLength")}}