Untitled
Anonymous
JavaScript
05/07/2024 6:06 PM
319 B
37
Indexable
Never
const content = document.getElementById("content");
const button = document.getElementById("font-toggle");
let fontSize = 16; // Initial font size
button.addEventListener("click", function() {
if (fontSize === 16) {
fontSize = 20;
} else {
fontSize = 16;
}
content.style.fontSize = fontSize + "px";
});Editor is loading...
Leave a Comment