I am trying to change the font size variable in my P
tag using the DOM, but I am struggling to find a way to access it and modify the styles. I attempted the following code:
document.body.p.style.font-size = ""+p_var+"px";
I have also tried using various methods like setAttribute
, but so far, I have had no success. Can someone please demonstrate how to change the font size variable if it is possible?