// Add event listener for character count document.getElementById('inputText').addEventListener('input', updateCharCount); // Optional: Auto-translate as user types (with debounce) let timeoutId; document.getElementById('inputText').addEventListener('input', function() { updateCharCount(); clearTimeout(timeoutId); timeoutId = setTimeout(() => { if (this.value.trim()) { translateText(); } }, 1000); // Wait 1 second after user stops typing });
button:active { transform: translateY(0); } google translate jawi kepada rumi
function clearText() { document.getElementById('inputText').value = ''; document.getElementById('outputText').textContent = ''; document.getElementById('error').style.display = 'none'; updateCharCount(); } // Add event listener for character count document
.clear-btn { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); } function() { updateCharCount()