JSFiddle - React, Tailwind, and code Playground
by xavi3r
HTML
<form id="form">
<input type="text" value="Here is some data" id="data" />
<input type="button" value="Clear Input" id="button" />
</form>
JavaScript
$(function(){
$('#button').click(function(){
$(':input','#form')
.not(':button, :submit, :reset, :hidden')
.val('')
.removeAttr('checked')
.removeAttr('selected');
});
});