I have two inputs with classes (q1, q2) and a div with class (output). I would like to be able to hide the div when one or all of the inputs have "any value". I'm new to javascript.
$(document).ready(function() {
$('.q1, .q2').keyup(function() {
if ($(this).val().length == 0) {
$('.output').show();
} else {
$('.output').hide();
}
}).keyup();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="output">Test</div>
<input type="text" value="" class="q1">
<input type="text" value="" class="q2">