Document object in JavaScript is one of the most commonly used objects. The main purpose of the document object is to write something to the web page, or more appropriately is to display text content on a web page. The document object also holds all the information contains in a web page, such as its background color, foreground color, its title , the date the web page was last modified and more. It can be used to customize webpages.