JSFiddle - React, Tailwind, and code Playground
by Noranterry
HTML
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
<input type="text"/>
CSS
input{
display:block;
}
JavaScript
$('input[type=text]').each(function(){
var $this = $(this);
$('<div class="clrInput"/>').css({
position:'absolute',
left: $this.offset().left + $this.width() + 10, //10 for extra spacing from edge
top: $this.offset().top,
width: $this.height(),
height: $this.height()
}).text(' X ').data('inputEQ', $this.index()).appendTo('body');
});
$(document).on('click', '.clrInput', function(){
$('input[type=text]').eq($(this).data('inputEQ')).val('');
});