Does javascript have to be in the head tags?

后端 未结 11 694
逝去的感伤
逝去的感伤 2020-11-27 03:46

I believe javascript can be anywhere (almost), but I almost always see it in between . I am using jquery and wanted to know if it has

11条回答
  •  [愿得一人]
    2020-11-27 04:12

    It can go in the head or body tag. Just keep in mind that it will execute whenever is read and not necessarily when the document is finished loading. Take a look here.

提交回复
热议问题