Best HTML attribute order for DOM queries

Is there an attribute order that makes DOM queries faster? For example, at the beginning of the \ end element.

When I cross the DOM up, will it be better to put attributes at the end and vice versa, when I cross the DOM down?

+6
source share
1 answer

No, the browser parses HTML and builds the DOM. At this point, the literal source of the page is no longer important, so DOM requests are not executed in order.

However, personally, I would like to put my identifier first, then a class, and then something else. For ease of reading.

+2
source

Source: https://habr.com/ru/post/913940/


All Articles