JSFiddle - React, Tailwind, and code Playground
HTML
<button type="button" id="btn001">Hide</button>
<br/>
<p id="p001" class="article">Some contents...</p>
<button type="button" id="btn002">Hide</button>
<br/>
<p id="p002" class="article">Other content...</p>
<!-- more paragraphs -->
JavaScript
$("#btn001").click(handleHideShow);
$("#btn002").click(handleHideShow);
function handleHideShow(event) {
$(this).html(function (_, html) {
return html === "Show" ? "Hide" : "Show";
});
$('#' + this.id.replace('btn', 'p')).toggle();
}