Affects Version/s: 7.0.X, Master
- Go to the home page.
- View page source for that page (no need to log in).
- The search portlet includes an element of the form
<span class="" id="">
Observed: The value for the attribute id is the empty string.
Expected: The value for the attribute id shouldn't be empty or in that case not appear at all.
According to the HTML specification by the W3C (https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#the-id-attribute)
The id attribute specifies its element's unique identifier (ID). The value must be unique amongst all the IDs in the element's home subtree and must contain at least one character. The value must not contain any space characters. (The boldface is mine.)
Although there is no such requirement for the attribute class it might be preferable to avoid using it if empty.
Note: Having several html element with empty id attributes also leads to an accessibility failure due to having several elements sharing the same id value. See https://www.w3.org/TR/WCAG20-TECHS/F77.html.