Embedding, multimedia, data, and other content-related features.
<math>
<mapviewer>
hidden="until-found"
Intl.Segmenter
Intl.Locale
<template>
Display math directly in HTML, using MathML.
<!-- x² + 1 --> <math> <msup><mi>x</mi><mn>2</mn></msup> <mo>+</mo><mn>1</mn> </math>
Embed interactive maps in HTML.
<mapviewer controls width="600" height="400"> <maplayer src="osm.mapml"></maplayer> </mapviewer>
A set of directives from a website to a browser, that helps to detect and mitigate XSS attacks.
Content-Security-Policy: script-src 'self';
element.setHTML() and Document.parseHTML(). API to prevent XSS attacks by sanitizing untrusted strings of HTML.
element.setHTML()
Document.parseHTML()
greeting.setHTML('Hello ' + nameInput.value);
Hide an element until it is found (e.g. via a find-in-page search or when targeted by the URL hash).
<section class="drawer" aria-expanded="false" hidden="until-found"> <!-- content --> </section>
Language-sensitive segmentation of text into graphemes, words or sentences.
const segmenterFr = new Intl.Segmenter("fr", { granularity: "word" }); const string1 = "Que ma joie demeure"; const iterator1 = segmenterFr.segment(string1)[Symbol.iterator](); console.log(iterator1.next().value.segment); // Expected output: 'Que' console.log(iterator1.next().value.segment); // Expected output: ' '
The Intl.Locale API parses Unicode locale identifiers, with language, region, and script codes, such as zh-Hans-CN or en-GB.
zh-Hans-CN
en-GB
const us = new Intl.Locale("en-US");
Import HTML files via JS imports and access their elements and JS exports.
<script type="module"> import { TabList } from "./tablist.html" with { type: 'html' }; customElements.define("tab-list", TabList); </script>
A mechanism for holding HTML that is not to be rendered immediately but may be utilized later via JS.
<template id="counter"> <div class="counter">Clicked {{ times }} times</div> </template>
Think of content elements (iframes, headings, tables, sections), machine-readable data, internationalization & localization, etc. Missing features, browser incompatibilities, and other problems you face are all fair game.