title: Limiting length of each word in a string
body: <p>Is there a way to limit the length of each word in a string?</p>
  
  <p>For example:</p>
  
  <ol>
  <li>Loop through each word in a string</li>
  <li>If a word is longer than X amount of characters, display a pop up message and do not submit the form.</li>
  </ol>
  
  <p>Edit: My final code:</p>
  
  <pre><code>$("#comment-form").submit(function(event) {
      var str = $("#comment-box").val(), limit = 135;
  
      var wordList = str.split(' ');
  
      $(wordList).each(function(i, word) {
          if(word.length &gt; limit) {
              alert("Your comment has a string with more than " + limit + " characters. Please shorten it.");
              event.preventDefault();
          }
      });
  });
  </code></pre>