is it better to embed scripts in html or have them in a separate file?

Advantages for external js file

It separates HTML and code

It makes HTML and JavaScript easier to read and maintain

Cached JavaScript files can speed up page loads

Leave a Comment