JSFiddle - React, Tailwind, and code Playground

HTML

<body id="the_body">
<input id="template_1" value="Template 1" type="button"/>
<input id="template_2" value="Template 2" type="button"/>
</body>

CSS

.template_1{
    color:red;
}
.template_2{
    color:blue;
}

JavaScript

$(function() {
      $("#template_1").click( function()
           {
             $("#the_body").html("<p class='template_1'>template 1</p>");
           }
      );
    $("#template_2").click( function()
           {
             $("#the_body").html("<p class='template_2'>template 2</p>");
           }
      );
});