0
How to increase and decrease the font with each click? I was looking for ways to do this dynamically, but only found an example in jQuery here, but my project doesn’t use jQuery, how can I do this using pure javascript?
My basic but static code:
function escala(size) {
var text = document.querySelector('p');
text.style.fontSize = size + 'px';
}
<button onclick="escala(10)">-</button><button onclick="escala(20)">+</button>
<p>FONT</p>