Harvard Extension School
CSCI E-12 Fundamentals of Web Site Development | Spring 2019

## JavaScript in HTML

External Script

      <script src="path/to/javascript/file.js" type="text/javascript" > </script>

Script within HTML document

      <script type="text/javascript">
       /*
         JavaScript code as content of script element
       */
      </script>

"Inline" scripts as values of event attributes (Avoid!)

      <a href="#"
        onclick="javascript:void(window.resizeTo(1024,768))">
        Size Window to 1024 x 768
      </a>

Copyright © David Heitmeyer