JSFiddle - React, Tailwind, and code Playground
HTML
<input id="val1" name="val1" value="0"/>
<input id="val2" name="val2" value="0"/>
<!-- Lets say I have a warning DIV with a message that I want to display
if both of these inputs have a value of "1" -->
<div id="myWarningDiv" style="display: none;" class="clswhatever">
You have done something wrong comrade!
</div>
JavaScript
$("#val1,#val2").on("input",function() {
var other = ($(this).get(0).id==="val1")?$("#val2"):$("#val1");
if($(this).val() == 1 && $(other).val() == 1) {
$("#myWarningDiv").show();
} else {
$("#myWarningDiv").hide();
}
});