Add SauceLabs browsers badge
[mootools.git] / Docs / Utilities / DOMReady.md
blobe34b94a9528e857993c83412f08fb0e4364bb7f4
1 # Window Event: domready
3 Contains the window [Event][] 'domready', which executes when the DOM is loaded.
5 To ensure that DOM elements exist when the code attempts to access them is executed, they need to be placed within the 'domready' event.
7 ### Example:
9         window.addEvent('domready', function() {
10                 alert('The DOM is ready!');
11         });
13 ### Notes:
15 - This event is only available to the window element.
16 - In some versions of Internet Explorer (ie. IE6) a script tag might be executed twice if the content-type meta-tag declaration is put after a script tag. The content-type should always be declared before any script tags.
18 ### See Also:
19 [Element.Event][Event]
21 [Event]: /core/Element/Element.Event