P粉0738579112023-08-22 16:32:39
After the body closing tag, only comments and closing tags of html elements are allowed to be added.
You can confirm via Specification or Validator.
Browsers may perform error recovery, and the HTML specification even describes how to recover in this case, but you should never rely on this.
With the advent of the defer
attribute, we can place script
inside
P粉2324090692023-08-22 15:46:00
It will not validate outside of the <body>
or <head>
tags. It also doesn't make much of a difference unless you're doing DOM manipulation before the
<html> .... <body> .... <script type="text/javascript" src="theJs.js"></script> </body> </html>