nth-child-of-attr.html (744B)
1 <!DOCTYPE html> 2 <meta charset="utf-8" /> 3 <title>CSS Selectors Invalidation: :nth-child(... of attribute)</title> 4 <link rel="author" title="Steinar H. Gunderson" href="sesse@chromium.org"> 5 <link rel="match" href="nth-child-of-attr-ref.html"> 6 <link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index"> 7 <style> 8 p:nth-child(even of [attr="yes"]) { 9 color: green; 10 } 11 </style> 12 <div> 13 <p>Ignored</p> 14 <p attr="no">Ignored</p> 15 <p attr="yes">Not ignored</p> 16 <p attr="yes" id="toggler">Selectively ignored</p> 17 <p attr="yes">Not ignored</p> 18 <p attr="yes">Not ignored</p> 19 <p attr="yes">Not ignored</p> 20 <p>Ignored</p> 21 </div> 22 <script> 23 document.documentElement.offsetTop; 24 toggler.setAttribute("attr", "no"); 25 </script>