DEV Community

Discussion on: How would you refactor this JS function?

Collapse
 
baenencalin profile image
Calin Baenen

According to w3 guidelines, a space should be included before the trailing / and > of empty elements, for example,

I don't think your example works as intended.

Also, why is that? Does the space do something to make the HTML more understandable to some interpreters?

Thread Thread
 
rkallan profile image
RRKallan

edited my comment

According to w3 guidelines, a space should be included before the trailing / and > of empty elements, for example, <br />. These guidelines are for XHTML documents to render on existing HTML user agents.