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
No. SCRIPT
is not only categorized as head.misc element but also as special element and thus everywhere allowed where inline elements are allowed. So you can put a SCRIPT
wherever inline elements are allowed:
foo
In fact, some recommend to put SCRIPT elements at the end of the BODY just before the closing tag so that the whole document is parsed before the JavaScript is loaded. That is to prevent JavaScript from blocking parallel downloads.