Skip to content

Commit 7a8c685

Browse files
authored
Merge pull request #185 from Hobsons/label_no_for
Fixing eroneous bad id for labels with no for attribute
2 parents aee9e1e + 349aa46 commit 7a8c685

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
130130
this._labelNames = {};
131131
var labels = top.getElementsByTagName('label');
132132
for (var i = 0; i < labels.length; i++) {
133-
if ((labels[i].getAttribute('for') !== null) || (labels[i].getAttribute('for') !== '')) {
133+
if ((labels[i].getAttribute('for') !== null) && (labels[i].getAttribute('for') !== '')) {
134134
var labelFor = labels[i].getAttribute('for');
135135
if ((this._labelNames[labelFor]) && (this._labelNames[labelFor] !== null)) {
136136
this._labelNames[labelFor] = null;

0 commit comments

Comments
 (0)