JSFiddle - React, Tailwind, and code Playground

by irwan dwiyanto

HTML

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

JavaScript

$('#button').click(function(){
		$(this).text(function(_, val){
			return val == 'Save' ? 'Edit' : 'Save';
		});
	});