const countButton = document.getElementById("count-button"); const textInput = document.getElementById("text-input"); const wordCount = document.getElementById("word-count"); countButton.addEventListener("click", function() { const text = textInput.value; const words = text.split(" "); wordCount.innerHTML = `Word Count: ${words.length}`; });