Skip to main content

The :scope CSS pseudo-class represents elements that are a reference point for selectors to match against.
A situation where the :scope pseudo-class prove to be useful is when you need to get direct descendant of an already retrieved Element

element.querySelectorAll(":scope > .child");

#CSS #JavaScript #TIL

Random array using the modern Fisher–Yates shuffle algorithm in JavaScript:

#WebDev #JavaScript