Untitled
unknown
javascript
2 years ago
319 B
19
Indexable
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