Skip to content
Advertisement

How to create a button that increases text by 1px in JavaScript [closed]

I need your help. I’m a beginner in JavaScript and I want to create a button that increases text by 1px. Can you help me?

Advertisement

Answer

This should help! window.getComputedStyle(txt, null).getPropertyValue('font-size'); This is what you can use to get the fontSize of an element.

JavaScript
JavaScript
JavaScript
Advertisement