JSFiddle - React, Tailwind, and code Playground
HTML
<form action="">
<div class="inputfield">
<label for="">A</label>
<input type="checkbox" name="xyz" value="A" />
<label for="">B</label>
<input type="checkbox" name="xyz" value="B" />
</div>
</form>
<div class="one">Results for A</div>
<div class="one">Results for A</div>
<div class="two">Results for B</div>
JavaScript
var a = $(".one");
var b = $(".two");
a.hide();
b.hide();
$(".inputfield input[name='xyz']").change(function() {
var value = $(this).val();
if (this.checked) {
//console.log(value);
if (value == 'A') {
a.show();
b.hide();
}
if (value == 'B') {
a.hide();
b.show();
}
if (value == 'A' && value == 'B') {
a.show();
b.show();
}
} else {
a.hide();
b.hide();
}
});