Update article.md
This commit is contained in:
parent
9add0b1c88
commit
8c1b1ca4cf
1 changed files with 1 additions and 1 deletions
|
@ -399,7 +399,7 @@ Compare the two:
|
||||||
```
|
```
|
||||||
|
|
||||||
1. The first `<div>` gets the name "as HTML": all tags become tags, so we see the bold name.
|
1. The first `<div>` gets the name "as HTML": all tags become tags, so we see the bold name.
|
||||||
2. The second `<div>` gets the nams "as text", so we literally see `<b>Winnie-the-pooh!</b>`.
|
2. The second `<div>` gets the name "as text", so we literally see `<b>Winnie-the-pooh!</b>`.
|
||||||
|
|
||||||
In most cases, we expect the text from a user, and want to treat it as text. We don't want unexpected HTML in our site. An assignment to `textContent` does exactly that.
|
In most cases, we expect the text from a user, and want to treat it as text. We don't want unexpected HTML in our site. An assignment to `textContent` does exactly that.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue