About This HTML Issue
The HTML parser reads element attributes by looking for a name, then an =, then a value. When it encounters = in a spot where it expects a name to start, it means something has gone wrong with the attribute syntax. This can happen in several ways: an attribute name is missing entirely before the =, there’s a double == instead of a single =, a space was accidentally inserted in the middle of an attribute name, or a previous attribute’s value was left unquoted causing the parser to lose track of where one attribute ends and the next begins.
This is a problem because browsers may silently discard the malformed attribute, apply it incorrectly, or even misinterpret surrounding attributes. This leads to unpredictable behavior across different browsers. Screen readers and other assistive technologies may also fail to interpret the element correctly, creating accessibility issues.
How to Fix It
-
Check for missing attribute names — Make sure every
=sign is preceded by a valid attribute name likeclass,id,src, etc. -
Check for double equals signs — Replace any
==with a single=. - Check for spaces in attribute names — Attribute names cannot contain spaces. Remove accidental spaces within names.
- Check for unquoted attribute values — Always quote attribute values with double quotes. An unquoted value containing special characters can cause the parser to misread subsequent attributes.
-
Check for stray
=characters — Look for leftover=signs from copy-paste errors or incomplete edits.
Examples
Missing attribute name before =
An = appears with no attribute name before it:
<!-- ❌ Bad: no attribute name before = -->
<img ="photo.jpg" alt="A photo">
<!-- ✅ Fixed: added the src attribute name -->
<img src="photo.jpg" alt="A photo">
Double equals sign
A typo creates == instead of =:
<!-- ❌ Bad: double equals sign -->
<a href=="https://example.com">Link</a>
<!-- ✅ Fixed: single equals sign -->
<a href="https://example.com">Link</a>
Space inside an attribute name
A space splits what should be one attribute name into two tokens, leaving an orphaned =:
<!-- ❌ Bad: space in "data-value" splits the attribute -->
<div data- value="10">Content</div>
<!-- ✅ Fixed: no space in the attribute name -->
<div data-value="10">Content</div>
Unquoted attribute value causing a cascade
When a value isn’t quoted, the parser can misinterpret where it ends, causing the next attribute’s = to appear in an unexpected position:
<!-- ❌ Bad: unquoted class value with space causes parsing issues -->
<p class=my class id="intro">Text</p>
<!-- ✅ Fixed: properly quoted attribute value -->
<p class="my-class" id="intro">Text</p>
Stray = from an incomplete edit
A leftover = from a deleted or partially edited attribute:
<!-- ❌ Bad: stray = left over after removing an attribute -->
<div class="container" = >Content</div>
<!-- ✅ Fixed: removed the stray = -->
<div class="container">Content</div>
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.