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

data-link-for

Applies to: <a>, <section>, <p>, other elements

Sets the default lookup context (scope) for links — matches definitions that have a corresponding data-dfn-for. Use this when two interfaces have members with the same name.

Usage

<!-- Link to Request's url, not Response's url -->
<a data-link-for="Request">url</a>

<!-- Preferred shorthand: -->
[= Request/url =]
{{ Request/url }}
<section data-link-for="Request">
  <p>The <a>method</a> attribute returns the HTTP method.</p>
  <p>The <a>url</a> attribute returns the request URL.</p>
</section>

Notes

  • Set data-link-for on a <section> (or <p>) to apply the scope to all links within it — avoids repeating on every <a>
  • The [= Interface/member =] and {{ Interface/member }} shorthands are preferred over data-link-for on individual links
  • Use data-dfn-for to set scope on definitions (not links)
  • See the Shorthands Guide for the [= =] and {{ }} syntaxes

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