Skip to content

$.onEvent()

Arthur Guiot edited this page Jul 5, 2017 · 1 revision

How it works?

The $.onEvent() makes possible to manage a lot of different event through HTML attributes/tags. It's super simple and intuitive, you simply need to add the attributes on="" and action="" to an HTML element and to run this function, and you're done.

⚠️This function doesn't support the "push" method, so you can only use it once.

How to use it?

As I said, it's super simple and intuitive, so let's take an example to make sure it's clear.

Let's say you have a button and when you click on it, there is an alert poping up.

HTML:

<button on="click" action="alert('You clicked on me!')">Click on me!</button>

JS:

$.onEvent();

⚠️ Questions?

Don't hesitate to ask your questions ⁉️ in the issue part 😁

Clone this wiki locally