Javascript Document - 88 Events (Reference)
The HTML DOM Document is the root node of the document tree. This document object represents the entire web page. Document object provides methods to access/modify the document's information.
Document Events:
Document Events (also available in Window and Element):
visibilitychange
The visibilitychange event is fired when the visibility of the document changes.
document.addEventListener('visibilitychange', fn_name(e));
document.onvisibilitychange = function(){ // code )};
DOMContentLoaded
The DOMContentLoaded event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
document.addEventListener("DOMContentLoaded", fn_name(e));
readystatechange
The readystatechange event is fired when the readyState attribute of the Document object changes.
document.addEventListener('readystatechange', fn_name(e));
document.onreadystatechange = function(){ // code )};
pointerlockchange
The pointerlockchange event is fired when the pointer is locked or unlocked.
document.addEventListener('pointerlockchange', fn_name(e));
document.onpointerlockchange = function(){ // code )};
pointerlockerror
The pointerlockerror event is fired when the pointer can not be locked.
document.addEventListener('pointerlockerror', fn_name(e));
document.onpointerlockerror = function(){ // code )};
fullscreenchange
The fullscreenchange event is fired when the document enters or leaves fullscreen mode.
document.addEventListener('fullscreenchange', fn_name(e));
document.onfullscreenchange = function(){ // code )};
fullscreenerror
The fullscreenerror event is fired when the document can not enter fullscreen mode.
document.addEventListener('fullscreenerror', fn_name(e));
document.onfullscreenerror = function(){ // code )};
Common events
Document Events which also available in Window and Element are listed here.
