Javascript font size(increase/decrease) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Javascript font size(increase/decrease)

https://code.sololearn.com/WEa6KWy357ZY/?ref=app In the coding attached, the font sizing increase/ decrease function buttons seems to work but only on the ā€˜font sizeā€™ paragraph. I was intending to change the font size of the whole page. What am I doing wrong here? Thanks

4th Mar 2020, 11:54 PM
Szan GulƩ
2 Respostas
+ 2
line 76 and line 89 change to apply on document.body
5th Mar 2020, 12:12 AM
Gordon
Gordon - avatar
+ 2
Szan GulƩ hi,it seems you apply your style.fontSize only to the element with id=changesize which is that specific div. either you could try to give a class=changesize to all the elements you'd like to resize either you could apply that to your body element document.querySelector("body"). And manipulating values sometime things could not occurs as expected because of specifity in CSS so you could check that for awareness : https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
5th Mar 2020, 12:25 AM
EmmanueLZ.
EmmanueLZ. - avatar