document.addEventListener("DOMContentLoaded", function() { const previewText = document.getElementById("preview-text"); const customText = document.getElementById("custom-text"); const fontSizeSlider = document.getElementById("font-size-slider"); const fontSizeValue = document.getElementById("font-size-value"); customText.addEventListener("input", function() { if (customText.value !== '') { // Check if custom text input is not empty previewText.textContent = customText.value; // Set preview text to custom text input } else { previewText.textContent = customText.placeholder; // Set preview text to placeholder if custom text input is empty } }); fontSizeSlider.addEventListener("input", function() { const fontSize = fontSizeSlider.value + "px"; previewText.style.fontSize = fontSize; fontSizeValue.textContent = fontSize; }); });

Don't work Harder  Buy smarter ๐Ÿ’ธ