You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/1-document/07-modifying-document/article.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ First we'll see a simple example and then explain the methods.
10
10
11
11
## Example: show a message
12
12
13
-
For the start, let's see how to add a message on the page that looks nicer than `alert`.
13
+
For a start, let's see how to add a message on the page that looks nicer than `alert`.
14
14
15
15
Here's how it will look:
16
16
@@ -153,7 +153,7 @@ These methods are "old school": they exist from the ancient times and we can mee
153
153
154
154
For instance, how to insert *html* if we have it as a string? Or, given a node, how to insert another node *before* it? Of course, all that is doable, but not in an elegant way.
155
155
156
-
So there exists two other sets of insertion methods to handle all cases easily.
156
+
So there exist two other sets of insertion methods to handle all cases easily.
157
157
158
158
### prepend/append/before/after
159
159
@@ -279,7 +279,7 @@ The method has two brothers:
279
279
-`elem.insertAdjacentText(where, text)` -- the same syntax, but a string of `text` in inserted "as text" instead of HTML,
280
280
-`elem.insertAdjacentElement(where, elem)` -- the same syntax, but inserts an element.
281
281
282
-
They exist mainly to make the syntax "uniform". In practice, most of time only `insertAdjacentHTML` is used, because for elements and text we have methods `append/prepend/before/after` -- they are shorter to write and can insert nodes/text pieces.
282
+
They exist mainly to make the syntax "uniform". In practice, most of the time only `insertAdjacentHTML` is used, because for elements and text we have methods `append/prepend/before/after` -- they are shorter to write and can insert nodes/text pieces.
283
283
284
284
So here's an alternative variant of showing a message:
0 commit comments