JSFiddle - React, Tailwind, and code Playground
HTML
<p>normal</p>
<p>normal et <strong>gras</strong></p>
CSS
.test:hover { background-color: red; }
JavaScript
$( "p:has(strong)" ).addClass( "test" );
<p>normal</p>
<p>normal et <strong>gras</strong></p>
.test:hover { background-color: red; }
$( "p:has(strong)" ).addClass( "test" );