This is the code I am trying to use to create a function to increase/ decrease text size on my page: this is the error i get: "main.js (65,19) Syntax error"
function changeFontsize(type)
{
let ids = ["#h3", "#p" ];
ids.forEach( id => {
let el = document.querySelector(id);
let fontSize = window.getComputedStyle(el, null).getPropertyValue("font-size");
fontSize = parseFloat.(fontSize);
if(type === "increase")
{
el.style.fontSize = (fontSize + 5) + "px" ;
}
else
{
el.style.fontSize = (fontSize - 5) +"px";
}
});
}
Syntax error is in this line:
parseFloat.(fontSize)
Remove .:
parseFloat(fontSize)