Web Development JavaScript Beginner
Q What is the difference between innerHTML and textContent?
  • A textContent parses HTML
  • B innerHTML parses its value as HTML (an XSS risk with untrusted data); textContent treats it as plain text
  • C innerHTML escapes all tags
  • D They are identical
Leave a Comment