
Answer is 1 and 3. Whereas in the solution 1 and 2 show the same result due to different order.
18 lines
356 B
Markdown
18 lines
356 B
Markdown
Answer: **1 and 3**.
|
|
|
|
Both commands result in adding the `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.innerHTML = text;
|
|
elem3.textContent = text;
|
|
</script>
|
|
```
|