JSFiddle - React, Tailwind, and code Playground

by devcurry_com

HTML

<input id="Button1" type="button" value="Button One" class="btn"/>
    <input id="Button2" type="button" value="Button Two"  class="btn"/>
    <input id="Button3" type="button" value="Button Three"  class="btn"/>
  <br/><br/> 
   <p>Demo by <a href="http://www.devcurry.com/search/label/jQuery">DevCurry.com</a> </p>

CSS

.bgClr{        
        background-color:Green;
    }

JavaScript

$(function () {
            $(".btn").click(function () {
                $('.btn').removeClass('bgClr'); 
                $(this).addClass('bgClr'); 
            });
        });