Are apostrophes valid containers for HTML element attribute values?

Typically, the values ​​of the attributes of an HTML element are marked with a quotation mark, for example


<input type="hidden" value="test" />

Sometimes, however, you see code like


<input type='hidden' value='test' />

Is it valid HTML and can it cause any problems? How about mixing two for example


<input type='hidden' value="test">

?

+5
source share
1 answer

A related question from James Allardis's comment on my original question led me to the answer: yes, apostrophes are valid containers for HTML element attribute values.

Specification: In SGML and HTML

SGML , (ASCII- 34) (ASCII- 39). , .

+4

All Articles