JSFiddle - React, Tailwind, and code Playground
HTML
<label>
<input id="option1" type="checkbox"> Вариант 1
</label>
<label>
<input id="option2" type="checkbox"> Вариант 2
</label>
<label>
<input id="option3" type="checkbox"> Вариант 3
</label>
<p class="option1"> строки первого варианта </p>
<p class="option2"> строки второго варианта </p>
<p class="option3"> строки третьего варианта </p>
JavaScript
$(document).ready(function(){
$('label input[type=checkbox]').change(function(){
$('label input[type=checkbox]').each(function(){
var id = $(this).attr('id');
if ($(this).is(':checked')) {
$('.'+id).show();
} else {
$('.'+id).hide();
}
});
});
$('label input[type=checkbox]').each(function(){
var id = $(this).attr('id');
if ($(this).is(':checked')) {
$('.'+id).show();
} else {
$('.'+id).hide();
}
});
});