Script Tag in XHTML

This may sound like an unrealistic question, but ...

why browsers follow this syntax:

<script type='text/javascript' src="/path/to/my.js" /> 

and instead want

 <script type='text/javascript' src="/path/to/my.js"></script> 

It seems the first construct should be valid, as there is no internal content inside the tag.

?

+4
source share

Source: https://habr.com/ru/post/1307403/


All Articles