asfallows
asfallows

Reputation: 6108

Is there a difference between attribute and attribute=""

I'm using a tool called whacko to parse and manipulate HTML files.

One of the side effects it has is that it turns

<div flex class="flexible">
  <b>Content</b>
</div>

into

<div flex="" class="flexible">
  <b>Content</b>
</div>

And likewise for other empty attributes.

Does this difference pose any problems? Is the flex="" form invalid, does it need to be handled differently?

Upvotes: 0

Views: 91

Answers (1)

fgb
fgb

Reputation: 18559

According to the html5 spec, they're the same:

Empty attribute syntax

Just the attribute name. The value is implicitly the empty string.

For XHTML syntax, the value is required explicitly.

Upvotes: 2

Related Questions