JSFiddle - React, Tailwind, and code Playground
HTML
<div id="size">
<p>xs</p>
<p>s</p>
<p>m</p>
<p>l</p>
<p>xl</p>
</div>
JavaScript
$(document).ready(function() {
jQuery('#size p').each(function(){
var html = '<input type="checkbox" value="' + jQuery(this).text() + 'id="size" name="size[]" checked />';
jQuery(this).replaceWith(html);
});
});