Javascript - count words

Does anyone know how to count words automatically in text area. Using javascript or whichever language.
For example, as i type, theres another box showing how many words i have typed. It increase automatically