{
  "id": "enwiki-001361214276",
  "slug": "dynamic-html",
  "title": "Dynamic HTML",
  "qid": "",
  "lead": "Dynamic HTML, or DHTML, is a term which was used by some browser vendors to describe the combination of HTML, style sheets and client-side scripts (JavaScript, VBScript, or any other supported scripts) that enabled the creation of interactive and animated documents. DHTML was introduced by Microsoft with the release of Internet Explorer 4 in 1997. DHTML allows scripting languages, such as JavaScript, to modify variables and elements in a web page's structure, which in turn affect the look, behavior, and functionality of otherwise \"static\" HTML content after the page has been fully loaded and during the viewing process. Thus the dynamic characteristic of DHTML is the way it functions while a page is viewed, not in its ability to generate a unique page with each page load. By contrast, a dynamic web page is a broader concept, covering any web page generated differently for each user, load occurrence, or specific variable values. This includes pages created by client-side scripting and ones created by server-side scripting (such as PHP, Python, JSP or ASP.NET) where the web server generates content before sending it to the client. DHTML is the predecessor of Ajax and DHTML pages are still request/reload-based. Under the DHTML model, there may not be any interaction between the client and server after the page is loaded; all processing happens on the client side.…",
  "body": "Dynamic HTML, or DHTML, is a term which was used by some browser vendors to describe the combination of HTML, style sheets and client-side scripts (JavaScript, VBScript, or any other supported scripts) that enabled the creation of interactive and animated documents. DHTML was introduced by Microsoft with the release of Internet Explorer 4 in 1997. DHTML allows scripting languages, such as JavaScript, to modify variables and elements in a web page's structure, which in turn affect the look, behavior, and functionality of otherwise \"static\" HTML content after the page has been fully loaded and during the viewing process. Thus the dynamic characteristic of DHTML is the way it functions while a page is viewed, not in its ability to generate a unique page with each page load. By contrast, a dynamic web page is a broader concept, covering any web page generated differently for each user, load occurrence, or specific variable values. This includes pages created by client-side scripting and ones created by server-side scripting (such as PHP, Python, JSP or ASP.NET) where the web server generates content before sending it to the client. DHTML is the predecessor of Ajax and DHTML pages are still request/reload-based. Under the DHTML model, there may not be any interaction between the client and server after the page is loaded; all processing happens on the client side. By contrast, Ajax extends features of DHTML to allow the page to initiate network requests (or 'subrequest') to the server even after page load to perform additional actions. For example, if there are multiple tabs on a page, the pure DHTML approach would load the contents of all tabs and then dynamically display only the one that is active, while AJAX could load each tab only when it is really needed. DHTML example function init() { let myObj = document.getElementById(\"navigation\"); // ... manipulate myObj } window.onload = init; Using a DOM function a { background-color: #eee; } a:hover { background: #ff0; } #toggleMe { background: #cfc; display: none; margin: 30px 0; padding: 1em; } Using a DOM function Show paragraph This is the paragraph that is only displayed on request. The general flow of the document continues. function changeDisplayState(displayElement, textElement) { if (displayElement.style.display === \"none\" || displayElement.style.display === \"\") { displayElement.style.display = \"block\"; textElement.innerHTML = \"Hide paragraph\"; } else { displayElement.style.display = \"none\"; textElement.innerHTML = \"Show paragraph\"; } } let displayElement = document.getElementById(\"toggle-me\"); let textElement = document.getElementById(\"showhide\"); textElement.addEventListener(\"click\", function (event) { event.preventDefault(); changeDisplayState(displayElement, textElement); }); ==Document Object Model== DHTML is not a technology in and of itself; rather, it is the product of three related and complementary technologies: HTML, Cascading Style Sheets (CSS), and JavaScript. To allow scripts and components to access features of HTML and CSS, the contents of the document are represented as objects in a programming model known as the Document Object Model (DOM). The DOM API is the foundation of DHTML, providing a structured interface that allows access and manipulation of virtually anything in the document. The HTML elements in the document are available as a hierarchical tree of individual objects, making it possible to examine and modify an element and its attributes by reading and setting properties and by calling methods. The text between elements is also available through DOM properties and methods. The DOM also provides access to user actions such as pressing a key and clicking the mouse. It is possible to intercept and process these and other events by creating event handler functions and routines. The event handler receives control each time a given event occurs and can carry out any appropriate action, including using the DOM to change the document. ==Dynamic styles== Dynamic styles are a key feature of DHTML. By using CSS, one can quickly change the appearance and formatting of elements in a document without adding or removing elements. This helps keep documents small and the scripts that manipulate the document fast. The object model provides programmatic access to styles. This means you can change inline styles on individual elements and change style rules using simple JavaScript programming. Inline styles are CSS style assignments that have been applied to an element using the style attribute. You can examine and set these styles by retrieving the style object for an individual element. For example, to highlight the text in a heading when the user moves the mouse pointer over it, you can use the style object to enlarge the font and change its color, as shown in the following simple example. Dynamic Styles ul { display: none; } Welcome to Dynamic HTML Dynamic styles are a key feature of DHTML. Change the color, size, and typeface of text Show and hide text And much, much more We've only just begun! function showMe() { document.getElementById(\"first-header\").style.color = \"#990000\"; document.getElementById(\"unordered-list\").style.display = \"block\"; } document.getElementById(\"clickable-link\").addEventListener(\"click\", function (event) { event.preventDefault(); showMe(); }); ==See also== Dynamic web page ==References==",
  "categories": [
    "11060667",
    "115984847",
    "116690184",
    "23117742",
    "23118434",
    "23603337",
    "28493675",
    "43849222"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1361214276",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1782470576.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001361214276",
    "type": "webpage",
    "title": "Dynamic HTML",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/dynamic-html",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          19
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          19
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001361214276",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1361214276",
    "note": "Immutable snapshot enwiki-001361214276"
  }
}