Hey there. For good practice, the Separation of Concerns is useful. There's nothing inherently wrong with using JS to change font size, but that is the domain of CSS. It is better to use JS to apply a CSS class to your HTML and change the size, and not style the font with JS directly. JS should govern behaviour, not presentation. Something to consider for you. Have a great day.
for Canvas : context.font="50px" for html element: element.style.fontSize="50px"