Event Listener
Alternatively you can use the .on() method
.on() method$('.button').on('click',function(e){
//perform action here
});
$('.button').on('mouseleave',function(e){
//perform action here
});
$('.button').on('submit',function(e){
//perform action here
});
$('.button').on('keypress',function(e){
//perform action here
});
//etc...Still loves addEventListener and onclick, ...?
Last updated