n
n
nexo
Search…
DOM Event handler

n.on(object, event, function);

Get object from id:
1
n.on(n.id('button'), 'click', () => {
2
console.log("Hi button!!")
3
})
Copied!
Get object from id width string:
1
n.on('#button', 'click', () => {
2
console.log("Hi button!!")
3
})
Copied!

n.on(class, event, function);

Get group objects from class:
1
n.on(n.class('buttons'), 'click', () => {
2
console.log("Hi buttons class!!")
3
})
Copied!
Get object from id width string:
1
n.on('.buttons', 'click', () => {
2
console.log("Hi buttons class!!")
3
})
Copied!
Last modified 1yr ago