Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

HTML concept: semantics

HTML semantics is the defined meaning of elements, attributes, and values, independent of their current visual appearance.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

element choice + valid content model → intrinsic document meaning and behavior

ol, nav, and button represent specific concepts and behavior; generic div and span do not replace them through styling.

An article should be a self-contained composition, a section a thematic grouping, and the h1 through h6 hierarchy should express structure within content models.

role and aria-* can supplement accessibility, but add no native behavior and should not contradict correct element semantics.

The example activates details through its summary and click(), observes open, and reads the machine datetime value of time.

Examples

<!doctype html>
<meta charset="utf-8">
<nav id="navigation"><a href="#story">Story</a></nav>
<article id="story">
  <h2>Release notes</h2>
  <p>Published <time id="published" datetime="2026-11-18">today</time>.</p>
  <details id="more"><summary id="toggle">Changes</summary><p>Parser fixes.</p></details>
</article>
<output id="result"></output>
<script>
const details = document.querySelector("#more");
const nav = document.querySelector("#navigation");
document.querySelector("#toggle").click();
result.textContent = `article=${story.localName}; heading=${story.querySelector("h2").localName}; datetime=${published.dateTime}; detailsOpen=${details.open}; navLinks=${nav.querySelectorAll("a").length}`;
</script>

Result

article=article; heading=h2; datetime=2026-11-18; detailsOpen=true; navLinks=1

The result verifies DOM behavior of several elements; it is not a complete structure or accessibility-tree audit.

Sources