window.document object for browser.
The window
object is a global object which has various object to access various functionality of browser. below diagram gives an overview of window object.
Here’s a bird’s-eye view of what we have when JavaScript runs in a web-browser:
In this article, we will look at the properties of the window.document
. if you do inspect and go to console and type window.document. Browser will provide autosuggestion with all available object inside the document object.
if you type window.document.location or document.location, you will get location object printed. and you can browser host,hostname,origin ,protocol ,port etc.
window.document.lastElementChild
The lastElementChild
property is a read-only property that gets the document’s last child element. Since a document object only has one child element, which is the html
, element. This the element that’s going to be returned. This property returns an Element
object, which has the…