Update article.md

This commit is contained in:
Uma Maheswar 2017-06-05 12:36:11 +05:30 committed by GitHub
parent 9add0b1c88
commit 8c1b1ca4cf

View file

@ -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.