JSFiddle - React, Tailwind, and code Playground

by Michel Plungjan

HTML

<div>---<input type='checkbox' id='inputCheckbox'/><strong>sdfsf</strong><p>dfsfsdsd</p></div>
    <input type="button" id="testPatternButton" value="click" />
<hr/>
<div id="out"></div>

JavaScript

$("#testPatternButton").on("click", function() {
    $("input:checked").each(function() {
      $("#out").html($(this).parent().contents().not('input')); // only the strong text shows up
    });
});