Invalid Attribute Value
Many HTML attributes are enumerated: they accept a fixed set of keywords and nothing else. target takes _blank, _self, _parent, _top or a browsing context name. loading takes lazy or eager. When the value is outside the list, the browser falls back to the default and says nothing, so the attribute looks applied while doing nothing.
How common is this error?
We ran this validator over the home page of the Tranco top 5,000 websites in August 2026. 794 of the 2,655 sites we could reach hit it. That makes it the 7th most common HTML problem we found, across 12,568 occurrences. See the full study.
Most frequent wording: Attribute "target" has invalid value ""
Why It Matters
Present on 29% of sites, most often as an empty target="" left by a template that had no value to fill in. The failure is silent by design, which is what makes it worth a validator: nothing in the browser, the console, or the rendered page tells you the attribute was ignored.
Common Causes
- Template interpolation that always prints the attribute, even when the variable is empty: target="{{ target }}".
- Treating an enumerated attribute as a boolean, or a boolean as a string.
- CMS fields that store an empty string rather than omitting the setting.
Code Examples
<!-- Empty value: not a valid browsing context name --> <a href="/docs" target="">Docs</a> <!-- Case matters for some, not others; the list does not include "Lazy" --> <img src="a.jpg" alt="A" loading="Lazy"> <!-- Not an enumerated value: this is a boolean attribute --> <input type="checkbox" checked="true">
<a href="/docs">Docs</a> <a href="/report.pdf" target="_blank" rel="noopener">Report</a> <img src="a.jpg" alt="A" loading="lazy"> <input type="checkbox" checked>
How to Fix
- 1Omit the attribute entirely rather than giving it an empty value. An absent target behaves as _self, which is what the empty string was trying to say.
- 2For boolean attributes (checked, disabled, required, readonly), the presence of the attribute is the value. checked="false" is checked.
- 3Guard templates so an attribute is only rendered when its value exists, instead of rendering an empty one.
- 4Check the allowed list on MDN when an attribute seems to have no effect; a silently rejected value is the usual cause.
Frequently Asked Questions
Why does target="" get flagged when it works?
Are HTML attribute values case-sensitive?
What is a boolean attribute exactly?
Check Your HTML Now
Our validator detects this error automatically and shows the exact line number.
Open HTML ValidatorRelated HTML Errors
Deprecated HTML Attribute
align, bgcolor, border and the anchor name attribute were removed from HTML5. Learn the modern replacement for each and why id beats name for anchors.
Missing Alt Attribute on Images
A missing alt attribute is the top accessibility error and a lost SEO chance. Learn why every img needs alt text and how to write it well for screen readers.
Duplicate ID Attributes
A duplicate id breaks JavaScript, anchor links, and screen reader navigation. Learn how to find and fix duplicate id attributes in your HTML the right way.