JSFiddle - React, Tailwind, and code Playground

by Nikita Rane

HTML

<button type="button" id="largefont">
   Font+</button>
    <button type="button" id="smallfont">
   Font-</button>
    <p>text size change</p>

CSS

p{
	font-size:12px;
}

JavaScript

$("#largefont").click(function(){
		
	 var size = parseInt($("p").css('font-size').replace('px',''),10);
	//alert(size);
	if( size < 30){
	$("p").css('font-size', size+1);}
	else
	{ alert("Max Font Size reached.")}

	});
   $("#smallfont").click(function(){
		
	 var size = parseInt($("p").css('font-size').replace('px',''),10);
	//alert(size);
	if( size > 12){
	$("p").css('font-size', size-1);}
	else
	{ alert("Min Font Size reached.")}

	});