JSFiddle - React, Tailwind, and code Playground

HTML

<span id='foo'>
  <input id='bar' type='Checkbox' checked='true'>
</span>
<p id='text'>

</p>

JavaScript

show = function(checkbox) {
  words = $('#text').text()
  $('#text').text(words + " " + $(checkbox).prop('checked'));
};

$(document).ready(function() {
  show($('#foo').children("input")[0]);
  show($('#bar')[0]);
  $('#bar').click(function() {
  	show($('#foo').children("input")[0]);
  	show($('#bar')[0]);
  })
});