JSFiddle - React, Tailwind, and code Playground

by irwan dwiyanto

HTML

<button type="button" id="button">Save</button>

JavaScript

$(document).ready(function() {
   $('#button').click(function(){

       if( $('#button').text()=='Save')
       {
           
              $('#button').text("Edit");
           
           
       }
           
           else
               
               
           {
                             $('#button').text("Save");
               
           }
      });
       });