Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS selectors get evaluated right-to-left. Do querySelectorAll() selectors get evaluated that way too?

Do querySelectorAll() selectors get evaluated right-to-left like CSS ones, or does it do so left-to-right?

like image 238
Eric Avatar asked Nov 03 '22 22:11

Eric


1 Answers

It's right to left, this why the right side should be more specific than the left side.

jQuery selectors should get more specific from left to right. Selectors are parsed in reverse order, so making sure that your most specific selector is on the right will increase performance..

It says "jQuery" but it's true for all CSS selectors.

like image 182
gdoron is supporting Monica Avatar answered Nov 09 '22 05:11

gdoron is supporting Monica