0

Change fontSize

Why the code doesn't work (in html <p id="text" >text text text<p> In js Add (addEventListener ) text.style.fontSize += 2 + 'px')

8th Nov 2021, 11:29 AM
golovastik
golovastik - avatar
4 Answers
+ 3
Can you please link your complete code? Put it on sololearn playground and link it here) From the snippets I cannot see what's going on.
8th Nov 2021, 11:38 AM
Lisa
Lisa - avatar
+ 2
Well you can try to change font in CSS.
8th Nov 2021, 11:53 AM
š“š“·š“¼š“±š“²š““š“Ŗ (Anshika)
š“š“·š“¼š“±š“²š““š“Ŗ (Anshika) - avatar
+ 1
We can use "getComputedStyle()" Next convert value "parseInt() " and get the value
8th Nov 2021, 12:13 PM
golovastik
golovastik - avatar
+ 1
Thanks everyone)
8th Nov 2021, 12:14 PM
golovastik
golovastik - avatar