Why don't self-closing script elements work?
Asked 07 September, 2021
Viewed 778 times
  • 55
Votes

What is the reason browsers do not correctly recognize:

<script src="foobar.js" /> <!-- self-closing script element -->

Only this is recognized:

<script src="foobar.js"></script>

Does this break the concept of XHTML support?

Note: This statement is correct at least for all IE (6-8 beta 2).

12 Answer