Skip to content

Commit

Permalink
add docs for multiple event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Cheong authored Nov 6, 2023
1 parent f41a39d commit afc68a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ Specifies the HTTP method to use when fetching data. If omitted, it defaults to

### `hx-event`

Specifies the event that triggers the data fetch. Defaults to `onload`. Possible values are `onload`, `onclick`, `onsubmit`, etc.
Specifies the event that triggers the data fetch. Defaults to `onload`. Possible values are `onload`, `onclick`, `onsubmit`, etc. You can define multiple events to listen by seperating them by commas.

```html
<template hx-endpoint="/api/data" hx-event="onclick"></template>
<template hx-endpoint="/api/data" hx-event="onchange, onload" hx-event-target="#select"></template>
```

### `hx-error`
Expand Down

0 comments on commit afc68a5

Please sign in to comment.