HTML5 Events
Event |
Description |
domcontentloaded |
Triggers after the DOM tree is formed (at the same time, pictures, CSS, and JavaScript may still be loading). In this event, the script runs earlier than the Load event, because the Load event waits for all resources to be triggered after the tablet or ad has finished loading. This way, the page will appear to load more quickly. |
Hashchange |
Triggered when the hash value of the URL changes (does not cause the entire window to refresh). Hash values are typically used in links to specify different parts (also known as anchor points), which are also used in page content loaded with Ajax. |
Beforeunload |
Triggered on the Window object before the page is unloaded. |
<! DOCTYPE html>
<title>todo supply a title</title>
<meta charset= "UTF-8" >
<meta name= "viewport" content= "Width=device-width, initial-scale=1.0" >
<body>
<input id= "message" type= "text" >
<script>
function Setup () {
var textinput = document.getElementById ("message");
Textinput.focus ();
}
window.addeventlistener (' domcontentloaded ', Setup, false);
</script>
</body>
JAVASCRIPT&JQUERY.HTML5 Events