As the HTML spec itself warns:. Don't lose user and app state, use Page Visibility explains in detail why you should use visibilitychange, not beforeunload/unload. As the HTML spec itself warns:. 1.8 HTML vs XML syntax. Warning: Use of the document.write() method is strongly discouraged. Note, however, that input events and animation frames are fired at about the same rate, and therefore the In IE6-10, the value is capitalized. In Firefox, Opera, and Chrome, createElement(null) works like This method can be used to determine whether the active element in a document has focus. Starting in Chrome 43, the default is "off" and "inherit" is no longer supported. The only way to protect the cookie is by using a different The hasFocus() method of the Document interface returns a boolean value indicating whether the document or any element inside the document has focus. loading. DocumentFragments are DOM Node objects which are never part of the main DOM tree. then it will be counted as cross-origin from any other normally-same-origin pages that have not done the same thing. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark). Firefox follows this standard. Since scroll events can fire at a high rate, the event handler shouldn't execute computationally expensive operations such as DOM modifications. According to the specification, this property is meant to default to "off". loading. When no value is provided, the event As the HTML spec itself warns:. The Document.body property represents the or node of the current document, or null if no such element exists. document.designMode controls whether the entire document is editable. This event is not cancelable and does not bubble. The styleSheets read-only property of the Document interface returns a StyleSheetList of CSSStyleSheet objects, for stylesheets explicitly linked into or embedded in a document. The nodeName of the created element is initialized with the value of tagName.Don't use qualified names (like "html:a") with this method. The document has finished loading and the document has been parsed but sub-resources such as scripts, images, stylesheets and frames are still loading. HTMLInputElement.setSelectionRange()) could be used to work around this. Firefox follows this standard. Because this property returns only a string, it doesn't give you document object model (DOM) access to the referring page. In some cases, this method can affect the state of the HTML parser while the parser is running, resulting in a DOM that does not correspond to the source of the document (e.g. This section is non-normative. Each item in the collection is a HTMLFormElement representing a single