Skip to content
Marcos Caceres edited this page Mar 27, 2026 · 3 revisions

data-type

Applies to: <var>

Declares the type of a variable in an algorithm. Used with the highlightVars feature to associate a type annotation with a variable.

Usage

<p>Let <var data-type="Request">request</var> be a new request.</p>

The |variable:Type| shorthand is equivalent:

<p>Let |request:Request| be a new request.</p>

Notes

  • |variable:Type| shorthand supports simple type names; for complex types (e.g., "valid" or "invalid") use the full <var data-type="..."> HTML syntax
  • Types are not validated against WebIDL — they are informational annotations for readers
  • See the Shorthands Guide for the full |variable:Type| syntax

Guides

Configuration options

W3C Configuration options

Linting rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements

HTML attributes

CSS Classes

Special properties

Clone this wiki locally