write function in JavaScript

document.write()

This function is used to write arbitrary HTML and content into page. If we use this function after an HTML document is fully loaded, will delete all existing HTML. It is used only for testing purpose.

Below some syntax of document.write() function

Syntax :-

Example:-

Output:-

Result Output

Chandan Kumar
Follow Me: