JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" id="test1" value="test1" />
<input type="button" id="test2" value="test2" />

<p>Test</p>

JavaScript

$( '#test1' ).click( function(){ alert( $( '<p>' ).html() ) } )
$( '#test2' ).click( function(){ alert( $( 'p' ).html()) } )