I'm new to JS. My goal is to make the font-size
of an HTML element increase as a function in JS loops.
I have gotten getElementById
to find the element by ID, my function loops ok and I have a variable increasing each time it loops, but the element is still not changing.
My JavaScript
let i = 0;
var myvar = setInterval(IconWeeder, 1500);
var element = document.getElementById("myDIV");
function bring_er_down() {
clearInterval(myvar);
console.log("we stopping")
}
function IconWeeder() {
element.style.fontSize = i;
i == i++
console.log("i is equal to:", i)
console.log(element)
}
<head>
<title>Font Size</title>
</head>
<p id="myDIV">I should change size</p>
<input type="button" value="stop" onclick="bring_er_down()"></input>
<script src="icons.js"></script>
Thanks!