JSFiddle - React, Tailwind, and code Playground
HTML
<input id="what" value="hey">
JavaScript
$('input').click(function() {
alert('hey');
}).each(function() {
var attrs = {},
ta = $('<textarea>');
$.each(this.attributes, function() {
attrs[this.name] = this.value;
});
$.each($(this).data('events'), function(i, f) {
$.each(f, function(){
ta.bind(i, this.handler);
});
});
$(this).replaceWith(ta.prop(attrs));
});