JSFiddle - React, Tailwind, and code Playground
HTML
<form action="#" method="post">
<input type="checkbox" name="one" id="one" value="x" /><label for="one">One</label>
<input type="checkbox" name="two" id="two" value="y" /><label for="two">Two</label>
<input type="checkbox" name="three" id="three" value="z" /><label for="three">Three</label>
</form>
<div id="div">
<ul>
</ul>
</div>
JavaScript
$(document).ready(
function(){
$('input:checkbox').change(
function(){
if ($(this).is(':checked')) {
$('<li />').appendTo('#div ul').text($(this).val());
}
else {
$('#div li:contains('+$(this).val()+')').remove();
}
});
});