Skip to content

Commit c7da122

Browse files
authored
Merge pull request #136 from joedolson/patch-1
Update html.md
2 parents 44682b4 + 3e11baa commit c7da122

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

wordpress-coding-standards/html.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,19 @@ Incorrect:
5555
<input type=text name=email disabled>
5656
```
5757

58-
In HTML, attributes do not all have to have values, and attribute values do not always have to be quoted. While all of the examples above are valid HTML, _failing to quote attributes can lead to security vulnerabilities_. Always quote attributes.
58+
In HTML, attributes do not all have to have values, and attribute values do not always have to be quoted. While all of the examples above are valid HTML, _failing to quote attributes can lead to security vulnerabilities_. Always quote attributes. Omitting the value on boolean attributes is allowed. The values `true` and `false` are not valid on boolean attributes ([HTML5 source](https://www.w3.org/TR/2011/WD-html5-20110405/common-microsyntaxes.html#boolean-attributes)).
59+
60+
Correct:
61+
62+
```html
63+
<input type="text" name="email" disabled />
64+
```
65+
66+
Incorrect:
67+
68+
```html
69+
<input type="text" name="email" disabled="true" />
70+
```
5971

6072
### Indentation
6173

0 commit comments

Comments
 (0)