Word Counter

Word Count: 0

function wordCounter(text) { var text = input.value.split(' '); var wordCount = 0; for (var i = 0; i < text.length; i++) { if (text[i] !== ' ') { wordCount++; } } count.innerText = wordCount; }

Comments

Popular posts from this blog