mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-29 05:51:39 +00:00
445 - Add hx-target="this" example
Added quick example for a link that can update itself using hx-target="this".
This commit is contained in:
parent
bb86628681
commit
303624b78f
@ -28,6 +28,11 @@ Here is an example that targets a div:
|
||||
|
||||
The response from the `/register` url will be appended to the `div` with the id `response-div`.
|
||||
|
||||
This example uses `hx-target="this"` to make a link that updates itself when clicked:
|
||||
```html
|
||||
<a hx-post="/new-link" hx-target="this" hx-swap="outerHTML">New link</a>
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
* `hx-target` is inherited and can be placed on a parent element
|
||||
|
Loading…
x
Reference in New Issue
Block a user