CS Fundamentals Trainer · JavaScript · Security
Which of these insert an untrusted string input into the DOM without it being parsed as HTML?
Which of these insert an untrusted string `input` into the DOM without it being parsed as HTML?
- `el.textContent = input`
- `el.insertAdjacentHTML('beforeend', input)`
- `el.append(document.createTextNode(input))`
- `el.outerHTML = input`
- `el.setAttribute('title', input)`
Difficulty: medium