Skip to content

Commit

Permalink
Page macro: remove from HTMLFormElement.elements (#14537)
Browse files Browse the repository at this point in the history
* Page macro: remove from HTMLFormElement.elements

* Update files/en-us/web/api/htmlformelement/elements/index.md
  • Loading branch information
hamishwillee authored Apr 1, 2022
1 parent 81de0d3 commit 2d9ca55
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions files/en-us/web/api/htmlformelement/elements/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,31 @@ index or the element's `name` or `id` attributes.
Prior to HTML 5, the returned object was an {{domxref("HTMLCollection")}}, on which
`HTMLFormControlsCollection` is based.

> **Note:** Similarly, you can get a list of all of the forms contained
> within a given document using the document's {{domxref("Document.forms", "forms")}}
> property.
> **Note:** Similarly, you can get a list of all of the forms contained within a given document using the document's {{domxref("Document.forms", "forms")}} property.
## Value

An {{domxref("HTMLFormControlsCollection")}} containing all non-image controls in the
form. This is a live collection; if form controls are added to or removed from the form,
this collection will update to reflect the change.
An {{domxref("HTMLFormControlsCollection")}} containing all non-image controls in the form.
This is a live collection; if form controls are added to or removed from the form, this collection will update to reflect the change.

The form controls in the returned collection are in the same order in which they appear
in the form by following a preorder, depth-first traversal of the tree. This is called
**tree order**.
The form controls in the returned collection are in the same order in which they appear in the form by following a preorder, depth-first traversal of the tree.
This is called **tree order**.

{{page("/en-US/docs/Web/API/HTMLFormElement", "Elements that are considered form controls")}}
Only the following elements are returned:

- {{HTMLElement("button")}}
- {{HTMLElement("fieldset")}}
- {{HTMLElement("input")}} (with the exception that any whose {{htmlattrxref("type", "input")}} is `"image"` are omitted for historical reasons)
- {{HTMLElement("object")}}
- {{HTMLElement("output")}}
- {{HTMLElement("select")}}
- {{HTMLElement("textarea")}}

## Examples

### Quick syntax example

In this example, we see how to obtain the list of form controls as well as how to
access its members by index and by name or ID.
In this example, we see how to obtain the list of form controls as well as how to access its members by index and by name or ID.

```html
<form id="my-form">
Expand Down

0 comments on commit 2d9ca55

Please sign in to comment.