Skip to main content
  • Why to use muliple script tags
    • code can be split in to multiple files
    • if files are not changed it will not load already loaded js
      • This is called browser Caching
  • Two ways of running js
    • giving a file
      •   <script src="script.js"></script>
        
    • writing code in script tag
      •   <script>
              // I can write js code here
              console.log("Code from inside the tag")
          </script>
        
    • Both cannot be done at same time
      •   <script src="script.js">
              console.log("Trying to executr both") // This is ignored
          </script>