What are the document methods supported by Legacy DOM?


The following is the list of document methods supported by Legacy DOM −

Sr.No
Property & Description
1
clear( )
Deprecated − Erases the contents of the document and returns nothing.
Ex − document.clear( )
2
close( )
Closes a document stream opened with the open( ) method and returns nothing.
Ex − document.close( )
3
open( )
Deletes existing document content and opens a stream to which new document contents may be written. Returns nothing.
Ex − document.open( )
4
write( value, ...)
Inserts the specified string or strings into the document currently being parsed or appends to document opened with open( ). Returns nothing.
Ex − document.write( value, ...)
5
writeln( value, ...)
Identical to write( ), except that it appends a newline character to the output. Returns nothing.
Ex − document.writeln( value, ...)

Updated on: 23-Jun-2020

52 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements