What happens when a string containing HTML tags is passed to document.write in JavaScript?
document.write
An error occurs, as document.write is not designed to process HTML.
The string is written to the document as plain text, displaying the HTML tags as part of the text.
document.write ignores the HTML tags and only writes the text contained within them.
The string is interpreted and rendered as HTML, where the HTML tags are processed creating the corresponding elements on the page.