code: function updateWordCount() {
          var wordCount = document.getElementsByClassName('entry-word-count')[0],
              editorValue = editor.getValue();
  
          if (editorValue.length) {
              wordCount.innerHTML = editorValue.match(/\S+/g).length + ' words';
          }
      }
docs: Really not the best way to do things as it includes Markdown formatting along with words