Increase font

by Joshua Powell

HTML

<p>
    Some text here
</p>
<div class="increase">Click to increase size.</div>

CSS

.increase {
    display: block;
    padding: 5px;
    background: mediumSeaGreen;
    width: 150px;
}

p {
    font-size: 12px;
}

JavaScript

$('.increase').on('click', function() {
    var fontSize = parseInt($("p").css("font-size"));
    fontSize = fontSize + 1 + "px";
   $("p").css({'font-size':fontSize}); 
});