JSFiddle - React, Tailwind, and code Playground
HTML
<p>When I click <code>this code</code> I want it to be selected.</p>
<p>The code tags don't have IDs or tag names.</p>
<p>Here's some <code>other code</code>.</p>
CSS
code {
background:#eee;
padding:0 2px;
}
JavaScript
/* Doesn't work */
$("code").click(function(){
$(this).select();
});