Skip to content

Z124 Opaque HTML Context

Z124 Opaque HTML Context

Severity: warning | Category: hygiene | Penalty: -1.0 pts

Z124 is triggered when an <a> or <img> tag uses blacklisted attributes like onclick or onmouseover.

Why it matters

Inline event handlers obscure the actual behavior of the link or image, bypassing standard static analysis and posing a potential security risk in documentation context.

Remediation

  • Remove inline JavaScript event handlers.
  • Use standard links, or bind events externally in a dedicated .js file if necessary.
<!-- Bad: triggers Z124 -->
<a href="/link" onclick="trackClick()">Link</a>

<!-- Good: standard behavior -->
<a href="/link" class="trackable">Link</a>