Skip to content
Merged
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
9 changes: 9 additions & 0 deletions www/content/attributes/hx-disabled-elt.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ Here is an example with a button that will disable itself during a request:
When a request is in flight, this will cause the button to be marked with [the `disabled` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled),
which will prevent further clicks from occurring.

The `hx-disabled-elt` attribute also supports specifying multiple CSS selectors separated by commas to disable multiple elements during the request. Here is an example that disables a button and a text input field during the request:

```html
<form hx-post="/example" hx-disabled-elt="input[type='text'], button">
<input type="text" placeholder="Type here...">
<button type="submit">Send</button>
</form>
```

## Notes

* `hx-disable-elt` is inherited and can be placed on a parent element