|
@@ -7,7 +7,7 @@
|
|
|
|
|
|
Корнем дерева элементов **DOM** является объект `document`
|
|
|
|
|
|
-## #Поиск элементов
|
|
|
+### Поиск элементов
|
|
|
|
|
|
Что бы найти элемент, нужно обратится к методу `document`, или любого другого элемента, в который нужно что-то найти:
|
|
|
|
|
@@ -81,6 +81,7 @@ document.addEventListener("mousemove",function(){
|
|
|
#### `children` и `childNodes`
|
|
|
- Узлами (`Node`) может быть любой текст в HTML, в том числе обычный текст и тот или иной тэг. Дочерние элементы каждого элемента находятся в **псевдомассиве** `childNodes`
|
|
|
- В **псевдомассиве** `children` находятся только дочерние узлы-тэги, но без обычного текста.
|
|
|
+
|
|
|

|
|
|
|
|
|
> Задание
|
|
@@ -91,9 +92,11 @@ document.addEventListener("mousemove",function(){
|
|
|
## Замыкания, приватные методы и данные.
|
|
|
|
|
|
> One of the conclusions that we reached was that the "object" need not be a primitive notion in a programming language; one can build objects and their behaviour from little more than assignable value cells and good old lambda expressions.
|
|
|
+>
|
|
|
> -— <cite>Guy Steele on the design of Scheme</cite>
|
|
|
|
|
|
> Closures are one of those few curious concepts that are paradoxically difficult because they are so simple. Once a programmer becomes used to a complex solution to a problem, simple solutions to the same problem feel incomplete and uncomfortable. But, as we will soon see, closures can be a simpler, more direct solution to the problem of how to organise data and code than objects.
|
|
|
+>
|
|
|
> -- <cite>Doug Hoyte</cite>
|
|
|
|
|
|
Функция в **JS** находится сразу в двух контекстах: *динамическом* (`this`, значения параметров) и *лексическом* (переменные из более высоких областей
|