How right is it put all the javascript code in the tags of the html file?Is it considered any better to put all the js code in separate .js files?I've noticed that many sites (including this) have some js code written in html file itself(enclosed in script tags).And lets say I decided to put all possible javascript code in separate files. Now, will those external files have access to the elements of the elements of the html document.I mean, lets say I want to create a new \[code\]<p>\[/code\] element with text everytime a user clicks a button. Will the external javascript file have access to the document elements to allow this?