How it works?
This function was created to quickly apply a style to an element. So, you only need to give it an element, a style name property and the value of this property.
⚠️ This function will only work with the native style=""
attribute of an element, which means that you can't modify the style that you defined in a .css
stylesheet.
How to use it?
As I said, this function requires 3 arguments. So, as an example, let's change the background color of an element when you hover it.
HTML:
<div class="testElement">Hello World 🌎!</div>
JS:
$.on($.select(".testElement"), "mouseover", function() {
$.css($.select(".testElement"), "background", "red")
})
⚠️ Questions?
Don't hesitate to ask your questions ⁉️ in the issue part 😁