JSFiddle - React, Tailwind, and code Playground
HTML
<input type='checkbox' id='inputCheckbox' /><strong>sdfsf</strong>
<p>dfsfsdsd</p>
JavaScript
$('input').on('click', function () {
inputhtml = $(this).clone().wrap('<div>').parent().html();
// console.log($(this).clone().wrap('<div>'));
allhtml = $(this).parent().html();
str = allhtml.replace(inputhtml, '');
console.log(str);
});