.nodeName gives the html tag used so you have to use .type to get the type of the node there.
Try this one:
console.log(event.target.type);
Demo
.nodeName gives the html tag used so you have to use .type to get the type of the node there.
Try this one:
console.log(event.target.type);
Demo