Document .write | Sololearn: Learn to code for FREE!


Document .write

why its necessary to use document .write and if we not use it then what will happen?

12/23/2016 3:23:21 AM

Omkar Dolase

1 Answer

New Answer


Document is an object that encompasses the whole html document, and write is a method to write directly to the document. document.write is really best for learning, testing and writing to files. If used on an existing html page it can overwrite your document. It is better to use other methods to manipulate the various document object model nodes like getElementById and innerHTML