For each click I want to increase the font size.
$('#fontplus').each(function('click') {
var fs = $('#bod').css('font-size');
$('#bod').css('font-size',fs+1);
});
<div id="fontplus">+</div>
Thanks
Jean
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well as you have probably discovered, that won’t work.
Now you have the current font size. However, what is it? Is it “12px”? Or perhaps it’s “1.5em”? Well, assuming you control that, what you’ll need to do is take apart the current setting and then put together the new value: