title: How/why is “ *[attribute^="string" ” a valid querySelector? (JS bug?)
body: <p>So, this might be a bug... I mistyped a CSS path to check for elements that had been processed to have a particular onclick function beginning <code>"ajaxLoad("</code></p>
  
  <pre><code>document.querySelectorAll( 'a[onclick^="ajaxLoad("' )
  </code></pre>
  
  <p>As you can see, I forgot to close the attribute accessor, with <code>]</code>, like so :</p>
  
  <pre><code>document.querySelectorAll( 'a[onclick^="ajaxLoad(]"' )
  </code></pre>
  
  <p>Weirdly, it worked!</p>
  
  <blockquote>
    <p><strong>Edit</strong> - no I didn't, I actually ran the correct CSS selector:</p>
  
  <pre><code>document.querySelectorAll( 'a[onclick^="ajaxLoad("]' )
  </code></pre>
    
    <p>... but as mentioned in the comments apparently this further typo also works!</p>
  </blockquote>
  
  <p>This is obviously invalid. I spotted it when I came to add another type of link, of class <code>tc-link</code>, and was wondering if I could just chain it like in CSS stylesheets as :</p>
  
  <pre>document.querySelectorAll( 'a[onclick^="ajaxLoad(", a.tc-link' )</pre>
  
  <p>The answer is that you can by closing that bracket, but <em>not</em> when this typo is left in.</p>
  
  <blockquote>
    <p>Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': 'a[onclick^="ajaxLoad(", a tc-link' is not a valid selector.</p>
  </blockquote>
  
  <p>It works on <code>^=</code>, <code>$=</code>, and <code>*=</code>, and from what I can see doesn't happen in Firefox or Opera (and I don't have any other browsers to test in).</p>
  
  <p>I was thinking this was a language quirk at first but revised question: can anyone work out which level (DOM? V8? Er.. webkit? I don't know the ins and outs that well) of Javascript/browser code this relates to, and where it can get reported/fixed?</p>