title: How to wrap each word of an element in a span tag?
body: <pre><code>$("div.date")
      .contents()
      .filter(
          function(){
              return this.nodeType != 1; 
          })
      .wrap("&lt;span/&gt;");
  </code></pre>
  
  <p>I am new and thought that code would have done the trick, but it wraps everything in the <code>&lt;span&gt;</code> like so:</p>
  
  <p><code>&lt;div class='date'&gt;&lt;span&gt;</code>Dec 22, 2011<code>&lt;/span&gt;&lt;/div&gt;</code></p>
  
  <p>It is supposed to look like this:</p>
  
  <pre><code>&lt;div class='date'&gt;
    &lt;span&gt;Dec&lt;/span&gt;
    &lt;span&gt;22,&lt;/span&gt;
    &lt;span&gt;2011&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>