Principles behind DOM element direct selection (dot notation)

101 Views Asked by At

Background info: I’m studying JavaScript, currently trying to understand DOM interactions, specifically direct selection (dot notation). It is worth noting that i’m a very theoretical learner and need to understand the principles in order to remember how things work and be able to use them properly.

The 3 classic examples given to clarify how direct selection (dot notation) works are:

  • document.documentElement
  • document.head
  • document.body

W3C says that these are the SOME of the most popular ways to select elements directly. So what are the rest? How do i find a full list of all possibilities to select elements via dot notation, and the principles behind how this works?

For example, i tried document.head.title, but that seems to be wrong… And some places suggest it is document.title, while other sources suggest it is limited to only those 3 options in the classical examples.

How does this whole DOM direct selection (dot notation) work? Can’t i navigate fully like this? Do i need to include the whole path or not? Does it work only on unique HTML tag elements? Or any HTML tag elements?

What are the principles behind this? I can’t find any information that actually explains this, except maybe MDN, but i find the language there is very unclear, so any clarification is very welcome.

Thanks in advance.

0

There are 0 best solutions below