I am doing a site for the visually impaired. I have three button:
I need by clicking add +2 pixels for font-size for the class *. Please help how it can I be implemented in javascript.
JQUERY
size=parseInt($('p').css('font-size'));
$("#big").on("click",function(){
size=size+2;
$("p").css("font-size",size + "px");
});
$("#normal").on("click",function(){
size=14;
$("p").css("font-size",size + "px");
});
$("#small").on("click",function(){
size=size-2;
$("p").css("font-size",size+ "px");
});
HTML
<p>CLICK ME!</p>
<button id='big'>BIG</button>
<button id='normal'>NORMAL</button>
<button id='small'>SMALL</button>
LINK JSBIN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With