What is the shortest selector (by character count) to select ALL html elements on a web page, without using asterisk (*)? Some examples are the following:
a,:not(a) /*9 chars*/
:nth-child(n) /*12 chars*/
:link,:not(:link) /*17 chars*/
Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It only takes a minute to sign up.
Sign up to join this community
·
element (it's an illegal tag name), so could you shortena,:not(a)
to:not(·)
? \$\endgroup\$document.createElement
threw an error but:not
did not. \$\endgroup\$:not(\\)
. I wonder why and how that works, but something like:not(^)
does not. \$\endgroup\$:not(\*)
and:not(\#)
\$\endgroup\$