Close HTML Script Tag [duplicate]

江枫思渺然 提交于 2019-12-03 22:12:07

The concept of self-closing tags is an XML concept. You can't use them in HTML. (You can use them in XHTML, but only if the document is served with an XML content-type, not if it is served as text/html).

In HTML some elements (such as <img>) cannot have any content, so they don't have end tags).

Since a script can have a src attribute or the script be can inside the element, <script> is not one of them.

(HTML 5 allows a / character to appear at the end of a start tag for an element that is defined as EMPTY, but it is just sugar for people addicted to XML and has no meaning in the language).

maybe u are using HTML 5 doctype, use html 4 doctype for this

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!