title: Jquery change each first .not('class')
body: <p>I'm trying to make a live search with effect in Jquery and I don't succeed to catch the first word in the text. I wrap each word in a span like that :</p>
  
  <pre><code>&lt;span class="word word-this" id="word-#" aria-hidden="true"&gt;this&lt;/span&gt;
  </code></pre>
  
  <p>And for the script I try to add a "readed" class to the word behind the one I search. Every-time I go to the next "this", all "this" words before have the class "readed". Like that :</p>
  
  <pre><code>var word = function(word) {
    $('span').each(function() {
      if ($(this).not('.readed') &amp;&amp; $(this).hasClass('word-'+word)){
        // transformation
        $('.word-'+word).first().css('color', 'red').addClass('readed');
      }
    });
  };
  </code></pre>
  
  <p>The problem is that it catch the first occurence of the word but it doesn't find the next, it stay on the first. It doesn't recognize that the "readed" class was added. I don't know if it's a .first() or .not() problem or another thing.</p>