Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<meta charset="utf-8">
<style>
#elements [blue] {
color: blue;
}
#elements :nth-child(1 of :not([blue])) {
color: revert;
}
</style>
<div id="elements">
<div blue>Child 1</div>
<div>Child 2</div>
</div>
<script>
requestAnimationFrame(() =>
requestAnimationFrame(() => {
elements.children[1].setAttribute("blue", "");
elements.children[1].removeAttribute("blue");
elements.children[0].removeAttribute("blue");
}));
</script>