Doubt on HTML code in project 3 Controlling Led

In project 3 named controlling LED, I have one doubt, In html code inside head tag, why we use two script tag. why can’t we put that second script tag code inside first script tag code to reduce the code length. Please reply as soon as possible!.

@ramanenvenki We use the first script tag to import an external javascript file, as you can see it has the src attribute.

Look at the second one, we write our own javascript, no src attribute.

This is the reason we use two tags.

@ramanenvenki Also we usually use multiple script tags in order to import more than one javascript files in a single html file, same is the case with css. If you have multiple css files for a single html file then you have to write multiple link tags to import them. Unfortunately we can’t do that in a single line :frowning:.

1 Like