aspose.info
EN

DHTML - Dynamic HTML File Format

Updated

What is a DHTML file?

A file with a .dhtml extension is a dynamic HTML file that is used to creating dynamic contents of a webpage. A web element created in DHTML is event driven and does not require to reload the page. In most of the cases, a DHTML file is used to create the dynamic contents of a webpage such as drop-down menus, floating layers, rollover buttons, and other dynamic content. You come across dynamic html elements almost daily in your life when you hover mouse on a menu item and it opens further sub-menu options. DHTML makes use of web technologies such as HTML, Javascript, HTML DOM, HTML Events and CSS to achieve the dynamic behaviour of elements.

DHTML File Format

DHTML files are plain text files that contain DHTML code to implement the dynamic behaviour of the web elements.

DHTML DOM

The DHTML Document object Model (DOM) is based on the HTML DOM that is a tree-structure with elements, attributes and text as shown in the following image.

HTML DOM

The Document node can be used to call several functions to implement different functionality. The following example simply uses the document.write() method of JavaScript in the DHTML.

<HTML>  
<head>  
<title>  
Method of a JavaScript  
</title>  
</head>  
<body>  
<script type="text/javascript">  
document.write("Hello World");  
</script>  
</body>  
</html>  

This code writes the text “Hello World” to output in browser.

DHTML Events

S.No.EventOccurence
1onabortIt occurs when the user aborts the page or media file loading.
2onblurIt occurs when the user leaves an HTML object.
3onchangeIt occurs when the user changes or updates the value of an object.
4onclickIt occurs or triggers when any user clicks on an HTML element.
5ondblclickIt occurs when the user clicks on an HTML element two times together.
6onfocusIt occurs when the user focuses on an HTML element. This event handler works opposite to onblur.
7onkeydownIt triggers when a user is pressing a key on a keyboard device. This event handler works for all the keys.
8onkeypressIt triggers when the users press a key on a keyboard. This event handler is not triggered for all the keys.
9onkeyupIt occurs when a user released a key from a keyboard after pressing on an object or element.
10onloadIt occurs when an object is completely loaded.
11onmousedownIt occurs when a user presses the button of a mouse over an HTML element.
12onmousemoveIt occurs when a user moves the cursor on an HTML object.
13onmouseoverIt occurs when a user moves the cursor over an HTML object.
14onmouseoutIt occurs or triggers when the mouse pointer is moved out of an HTML element.
15onmouseupIt occurs or triggers when the mouse button is released over an HTML element.
16onresetIt is used by the user to reset the form.
17onselectIt occurs after selecting the content or text on a web page.
18onsubmitIt is triggered when the user clicks a button after the submission of a form.
19onunloadIt is triggered when the user closes a web page.

References

See also