title: Find all span elements whose text does not contain a string
body: <p>I'm trying to find all <code>&lt;span/&gt;</code> elements which belongs to a specific class whose <code>text()</code> value does not contain part of a string.</p>
  
  <p>This is what I've attempted so far: </p>
  
  <pre><code>if ($("#details .error").not($(this).text().contains("This schedule is used")).length == 0) {
      //do something
  }
  else {
      //do something else   
  }
  </code></pre>
  
  <p>But I get a <code>Cannot read property '0' of undefined</code> error.
  Any help please?</p>