In js, how to determine whether the <script>·······</script> is written in the head or the body?
What’s the difference? Is there any small way to determine which area is written?
You can read this article: Where should js code be placed in HTML?
The referenced js file is placed in the head
You can read this article: Where should js code be placed in HTML?
The referenced js file is placed in the head