== document.onReady ==

document.onReady()

Attaches an event handler callback function to the “DOMContentLoaded” event of the [[mdn>Web/XPath/Functions/document|document]] object.
Usage:
[[mdn>Web/API/HTMLFormElement|HTMLFormElement]] = Form.''onReady''(callback)
Member of:
[[mdn>Web/XPath/Functions/document|document]]
Parameters:
callback – the function to call when the “DOMContentLoaded” event occurs (required).
Returns:
A reference to the [[mdn>Web/XPath/Functions/document|document]] object, thus allowing for command chaining.
Note:
This is just a shorthand function for the [[toolbox:event:on:index|.on]] method, specific for the “DOMContentLoaded” event. See there for more information and examples.
===== See also ===== * [[toolbox:event:on:index|.on]] * [[toolbox:event:off:index|.off]] ===== More information ===== * [[mdn>Web/API/HTMLFormElement|HTMLFormElement]] on MDN. * [[mdn>Web/XPath/Functions/document|document]] on MDN.