Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

write

The write() method of the Document object is used to write content within the <body> element of a web document. If used outside of the body element you will get an "unbalanced tree" warning in the web console.

Syntaxdocument.write( content );

Parameters

content The string or variable content to be rendered.

Examples

Output HTML content into the document body. <script> document.write( "<h2>some content</h2>" ); document.write( "<p>more content</p>" ); </script>

JavaScript

Methods

addEventListeneralertaveragebackblurconcatcreatedecodeURIdecodeURIComponentencodeURIencodeURIComponentevaleveryfilterforwardgoisArrayisFiniteisNaNjoinparseFloatparseIntpoppushpushStatereducereplaceStatereverseshiftshuffleslicesomesortspliceunshiftwrite