up
This commit is contained in:
parent
4272b7bb13
commit
508969c13f
168 changed files with 340 additions and 10 deletions
|
@ -0,0 +1,18 @@
|
|||
Answer: **1 and 3**.
|
||||
|
||||
Both commands result in adding `text` "as text" into the `elem`.
|
||||
|
||||
Here's an example:
|
||||
|
||||
```html run height=80
|
||||
<div id="elem1"></div>
|
||||
<div id="elem2"></div>
|
||||
<div id="elem3"></div>
|
||||
<script>
|
||||
let text = '<b>text</b>';
|
||||
|
||||
elem1.append(document.createTextNode(text));
|
||||
elem2.textContent = text;
|
||||
elem3.innerHTML = text;
|
||||
</script>
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue