Skip to content

Commit 0f6a7e0

Browse files
authored
Typo changes
- HTML is not really a language - I'd prefer to use the word 'parse' because it means, "The process of analyzing text made of a sequence of tokens to determine its grammatical structure ... . The parser then builds a data structure ... for compilers, interpreters or translators to create an executable program or library." Instead of just reading them. https://stackoverflow.com/questions/2933192/what-is-parsing-in-terms-that-a-new-programmer-would-understand
1 parent dac2e71 commit 0f6a7e0

File tree

1 file changed

+5
-5
lines changed
  • 2-ui/1-document/06-dom-attributes-and-properties

1 file changed

+5
-5
lines changed

2-ui/1-document/06-dom-attributes-and-properties/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Attributes and properties
22

3-
When the browser loads the page, it "reads" (another word: "parses") HTML text and generates DOM objects from it. For element nodes most standard HTML attributes automatically become properties of DOM objects.
3+
When the browser loads the page, it "reads" (another word: "parses") the HTML and generates DOM objects from it. For element nodes, most standard HTML attributes automatically become properties of DOM objects.
44

55
For instance, if the tag is `<body id="page">`, then the DOM object has `body.id="page"`.
66

@@ -51,7 +51,7 @@ So, DOM properties and methods behave just like those of regular JavaScript obje
5151

5252
## HTML attributes
5353

54-
In HTML language, tags may have attributes. When the browser reads HTML text and creates DOM objects for tags, it recognizes *standard* attributes and creates DOM properties from them.
54+
In HTML, tags may have attributes. When the browser parses the HTML to create DOM objects for tags, it recognizes *standard* attributes and creates DOM properties from them.
5555

5656
So when an element has `id` or another *standard* attribute, the corresponding property gets created. But that doesn't happen if the attribute is non-standard.
5757

@@ -83,9 +83,9 @@ Here we can see it:
8383
</body>
8484
```
8585

86-
So, if an attribute is non-standard, there won't be DOM-property for it. Is there a way to access such attributes?
86+
So, if an attribute is non-standard, there won't be a DOM-property for it. Is there a way to access such attributes?
8787

88-
Sure. All attributes are accessible using following methods:
88+
Sure. All attributes are accessible by using the following methods:
8989

9090
- `elem.hasAttribute(name)` -- checks for existence.
9191
- `elem.getAttribute(name)` -- gets the value.
@@ -138,7 +138,7 @@ Please note:
138138
1. `getAttribute('About')` -- the first letter is uppercase here, and in HTML it's all lowercase. But that doesn't matter: attribute names are case-insensitive.
139139
2. We can assign anything to an attribute, but it becomes a string. So here we have `"123"` as the value.
140140
3. All attributes including ones that we set are visible in `outerHTML`.
141-
4. The `attributes` collection is iterable and has all attributes with `name` and `value`.
141+
4. The `attributes` collection is iterable and has all the attributes of the element (standard and non-standard) as objects with `name` and `value` properties.
142142

143143
## Property-attribute synchronization
144144

0 commit comments

Comments
 (0)