I am a self learner of JS, but looking at many sites got confused where to put JS code? Should it be within the <head> tags, <body> tags or in-between? I saw web-sites which used all placements…
@VladdyMay 20.2005 — #Looking at the websites is about the worst way to learn - 99.9% of coding you find is incorrect.
Rule #1 for self learners (and the rest as well): [b]"When in doubt, [URL=http://www.w3.org/TR/1999/REC-html401-19991224/interact/scripts.html]RTFM[/URL]"[/b]
@TheBearMayMay 20.2005 — #Most commonly it is placed within the <head> tags, there are times however where you may want to place it in the <body> (generally when you want to make sure an HTML element has been instantiated before execution of the JS).