JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<button id="bye">Bye</button>
<button id="hello">Hello</button>
</div>
<div>
<p>1: <span id="greeting">Greeting</span></p>
</div>
CSS
div {
display: inline-block;
margin: 20px;
}
button {
display: block;
margin-top: 20px;
}
JavaScript
$('#hello').on('click', function() {
$('#greeting').text('Hello');
});
$('#bye').on('click', function() {
$('#greeting').text('Bye');
});