title: jQuery Select Element that has no Class or ID
body: <p>Trying to find a selector to get all elements that have both no class, and no id set to them. </p>
  
  <p>So far I have 2 different outputs depending on if there is a space in the selector:</p>
  
  <pre><code>                                      // outputs
          var noID = $('*:not([id])');// 144 - may have a class
          var noClass = $('*:not([class])');  // 100 - may have an id
  
          var withSpace = $('*:not([id]) *:not([class])'); // 99 ?
          var noSpace= $('*:not([id])*:not([class])'); // 84 ?
  </code></pre>
  
  <p>Which one is correct, my guess is the <code>noSpace</code> - but I don't know. Anyone tried this before?</p>
  
  <p>My guess is that with the space, the selector is going inside the tag that has no ID, and selecting the children elements that have no class associated with them.</p>
  
  <p>And the <code>noSpace</code> result is the correct one, as it selects only the elemets that have both no class, and no id.</p>
  
  <p>Can someone verify? Thanks!</p>
  
  <hr>
  
  <h2>Answer</h2>
  
  <p>Use this selector to find elements that have neither a class, or an id associated with them.</p>
  
  <pre><code>$('*:not([id]):not([class])');
  </code></pre>
  
  <p>bonus: <code>$('body *:not([id]):not([class])');</code> - If you only want to deal with the actual content</p>