Why don't self-closing script elements work?

前端 未结 12 2608
攒了一身酷
攒了一身酷 2020-11-21 04:12

What is the reason browsers do not correctly recognize:



        
12条回答
  •  粉色の甜心
    2020-11-21 05:03

    Unlike XML and XHTML, HTML has no knowledge of the self-closing syntax. Browsers that interpret XHTML as HTML don't know that the / character indicates that the tag should be self-closing; instead they interpret it like an empty attribute and the parser still thinks the tag is 'open'.

    Just as

提交回复
热议问题