I want to know which element has been clicked or keyuped. Something like the below:
$('button, input').on('click keyup', function() {
var self = $(this);
if (self == button)
...
else if (self == input)
...
};
I can’t do self.attr('name') == 'something' because the button has no name attribute.
What malificent meant was
though I would use a switch because it’s tidier