JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text">
<select>
<option value>---</option>
<option value='1'>2</option>
</select>
<input type="button" id="x" value="ClicK"/>
JavaScript
function hasUserProvidedInput() {
var returnValue = false;
$('input[type="text"],select').each(function() {
if ($(this).val() != '') {
returnValue = true;
return;
}
});
alert(returnValue);
return returnValue;
}
$('#x').click(hasUserProvidedInput);