title: :invalid and :required CSS pseudo-classes don't work with jQuery traversing methods when selector matches multiple form elements
body: <p><b>HTML</b></p>
  
  <pre><code>&lt;input required&gt;
  &lt;input required&gt;
  &lt;input required&gt;
  </code></pre>
  
  <p><b>JavaScript</b></p>
  
  <pre><code>/*
  // Add script for noted :invalid check to work
  // :required can also be made to work by modifying script, i.e. changing "invalid" to "required" where noted
  // Source: http://stackoverflow.com/a/15821264/2171842
  jQuery.extend(jQuery.expr[':'], {
      invalid : function(elem, index, match){ // modify pseudo-class here
          var invalids = document.querySelectorAll(':invalid'), // modify pseudo-class here
              result = false,
              len = invalids.length;
  
          if (len) {
              for (var i=0; i&lt;len; i++) {
                  if (elem === invalids[i]) {
                      result = true;
                      break;
                  }
              }
          }
          return result;
      }
  });
  */
  $(document).ready(function(){
    // works
    console.log("number of invalid elements: "+$(":invalid").length); // selector matches multiple elements
    console.log("is first element invalid? "+$("input:first").is(":invalid")); // selector matches one element
    console.log("is at least one element enabled? "+$("input").is(":enabled")); // selector matches multiple elements
    // fails without additional script, :required also fails
    console.log("is at least one element invalid? "+$("input").is(":invalid")) // selector matches multiple elements
    console.log("number of invalid elements: "+$("input:first").siblings(":invalid").andSelf(":invalid").length) // selector (siblings(":invalid")) matches multiple elements
  });
  </code></pre>
  
  <p>Console error: <code>Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: invalid</code>. Follow comments in code to navigate problem. Is this a bug or just an unsupported feature in jQuery?</p>
  
  <p><b>Fiddle</b></p>
  
  <p><a href="https://jsfiddle.net/cbqdp43s/" rel="nofollow">https://jsfiddle.net/cbqdp43s/</a></p>