Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

write html in javascript

document.write("<h2>Hello World!</h2><p>Have a nice day!</p>");

// WARNING: The write() method deletes all existing HTML when used on
// a loaded document.

// The write() method cannot be used in XHTML or XML.

// Read more at https://www.w3schools.com/jsref/met_doc_write.asp
 
PREVIOUS NEXT
Tagged: #write #html #javascript
ADD COMMENT
Topic
Name
7+4 =