Closing <script>

This is a stupid question, and I know that it is; but nonetheless, here he comes:

Is it possible to close the <script>-tag inside itself, so to speak? I mean, if you are using an external javascript document, you can close the tag as follows:

<script type="text/javascript" src="xxx.js" />
+5
source share
3 answers

As far as I know, no.

Browsers usually ignore closing tags script.

+3
source
+2
source

If an XHTML document is used as XML, then yes, that is perfectly true. However, if you use XHTML as HTML, it is not recommended , because the SGML parsers used by browsers to process HTML soup tags may have a problem with this. (If you decide to use self-closing tags scriptlike this, be sure to check in multiple browsers first!)

0
source

All Articles