![]() |
What is the difference between static html dynamic html?In: Web Programming |
[Edit] |
Static HTML is rendered once in the browser and never changed. Dynamic HTML (DHTML) may change as a result of conditions in a browser (e.g. a mouse click or pointer movement) without needing to fetch additional data from the server. For example, elements on the page may move or appear/disappear.
This is usually achieved through JavaScript (because it is supported on all major browsers) but can be done with any browser-supported scripting language that has access to the document's representation (commonly referred to as the Document Object Model (DOM)).
This term is not very clearly defined for some cases; for example changing the color of a link's contents when it is clicked or hovered over, or using CSS rules (such as a:hover) to show a submenu when the mouse hovers over a navigational menu. However, such cases are typically considered too simple to fall under the term DHTML.
Often, dynamic HTML is accompanied by asynchronous data retrieval (popularly known as Ajax), but technically the two techniques are separate and just happen to work well together, since the newly retrieved data needs to be displayed in the current document and thus the document changes.
Basic answer
----------------
Static HTML simply is what it is. The page is displayed and that's it.
Dynamic HTML uses a scripting language (like JavaScript) to change the HTML based on input or events. Example: roll-over graphics or buttons.
First answer by Kevindamm. Last edit by Kevindamm. Contributor trust: 17 [recommend contributor]. Question popularity: 7 [recommend question]





