2 ms·
OT note: sel.onclick=e=>{} works just fine. https://jsfiddle.net/39h5ynga/ https://jsfiddle.net/39h5ynga/
by 6510 4y ago
OT note: sel.onclick=e=>{} works just fine. https://jsfiddle.net/39h5ynga/ https://jsfiddle.net/39h5ynga/
- joshstrange 4y agoBut only if you (and any libs you use) only plan on adding 1 click handler to an element. That's why I always opt for the addEventListener/on style vs setting the onclick/ondblclick/etc handlers.
- 6510 4y agotrue but I would hope the libs use the event. (one onclick is still allowed in combination) This approach seems the funniest: https://jsfiddle.net/eu60Lwv9/ https://jsfiddle.net/eu60Lwv9/