JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" name="module" value="module&nbsp;1" />
<input type="checkbox" name="module" value="module&nbsp;2" />
<input type="checkbox" name="module" value="module&nbsp;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();
  }
});