JSFiddle - React, Tailwind, and code Playground
HTML
<input id = "1" type = "date"/>
<input id = "2" type = "text"/>
JavaScript
getType = function(id){
console.log($('#' + id).attr('type'));
}
$('input').click(function(){
getType($(this).attr('id'));
});