JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" class="lbl" value="Australia" />
<div id="result"></div>
<br />
<br/>
<input type="button" value="check" id="check_btn">
CSS
.error {
border: 1px solid red;
}
JavaScript
function check_fnc() {
jQuery('input').removeClass('error');
jQuery('input[value="Australia"]').each(function () {
$(this).addClass('error');
$('#result').html(this.value);
});
}
$('#check_btn').click(function () {
check_fnc();
})