Purpose of scripts in the <head> section:
When you place a script inside the <head> section, it will ensure that the script will be loaded before anyone uses it. And whenever you want the scripts to be executed when they are called or when an event is triggered then that script should go in to the <head> section.
Purpose of scripts in the <body> section:
When you place a script inside the <body> section it will generate the content of the page. And whenever you want the scripts to be executed when the page is loading, then the scripts should go in to the <body> section.
- Do console.log() of an HTML element to know properties and events
- Table ‘./DB_NAME/wp_posts’ is marked as crashed and should be repaired
- Change angular port from 4200 to some other port
- TypeScript Vs ES6 Vs ES5
- How to list all collections from mongo shell ?
- Create a new component in Angular 9 with CLI and without CLI ?