summaryrefslogtreecommitdiffstatshomepage
path: root/www/content/attributes
diff options
context:
space:
mode:
authoreduardolat <57238554+eduardolat@users.noreply.github.com>2024-03-21 15:25:49 -0600
committerGitHub <noreply@github.com>2024-03-21 15:25:49 -0600
commitc43d48163f578d2e6f719116da650ca351e323b2 (patch)
tree1c9fb15228368ccf76e5a0e4525295911cd5c577 /www/content/attributes
parent8318d9af6770e63d5fd0b9a2e4cebbb6d01395ef (diff)
downloadhtmx-c43d48163f578d2e6f719116da650ca351e323b2.tar.gz
htmx-c43d48163f578d2e6f719116da650ca351e323b2.zip
Add documentation for multiple CSS selectors in hx-disabled-elt (#2421)
This update clarifies the hx-disabled-elt attribute's ability to accept multiple CSS selectors, separated by commas, enabling developers to disable multiple elements simultaneously during an HTTP request.
Diffstat (limited to 'www/content/attributes')
-rw-r--r--www/content/attributes/hx-disabled-elt.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/www/content/attributes/hx-disabled-elt.md b/www/content/attributes/hx-disabled-elt.md
index 0b3e6afd..bc9faf93 100644
--- a/www/content/attributes/hx-disabled-elt.md
+++ b/www/content/attributes/hx-disabled-elt.md
@@ -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