JavaScript can be written at any place in the page or can be in external file. JavaScript is written in the head section in <script> tag.