JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" name="module" value="module 1" />
<input type="checkbox" name="module" value="module 2" />
<input type="checkbox" name="module" value="module 3" />
<div id="result"></div>
JavaScript
$('input[name="module"]').click(function(){
if (this.checked) {
var span = "<span id='" + this.value + "'>" + this.value + "<br /></span>";
$("#result").append(span);
}else{
$("#" + this.value).remove();
}
});