Listen for Browser Events: x-on

We can listen for browser events in AlpineJS just like we can in plain JavaScript. But unlike JavaScript, AlpineJS provides an elegant API to listen for and handle Document Object Model(DOM) events with the x-on directive.

Get hands-on with 1200+ tech skills courses.