JSFiddle - React, Tailwind, and code Playground
HTML
<div id="foo">
<div id="line1">...</div>
<div id="line2"><input type="text" value="foobar" /></div>
</div>
<a href="#">Click Me To Remove Value</a>
CSS
#line2 > input {
border : none;
background : transparent;
}
JavaScript
$('#line2').children('input').on('change', function () {
if (this.value == '') {
this.value = 'new';
}
});
$('a').on('click', function () {
$('#line2').children('input').val('').trigger('change');
});