I would like to execute multiple statements within a single Alpine.js event handler (however, I believe it could be generalized to any attribute).
An example of what I would like to achieve:
<button x-data
@click="alert('first')"
@click="alert('second')">
Click me
</button>
It is possible if you separate statements with a semicolon:
<button x-data
@click="alert('first'); alert('second')">
Click me
</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With