πŸ“Š JavaScript
Q. Where is the right place to insert JavaScript code?
  • (A) <head> section
  • (B) The two sections <head> and <body> are correct
  • (C) <body> section
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) The two sections <head> and <body> are correct

Explanation: We can insert javascript code in both head and body section.
But please keep a note that always try to keep javascript code in the bottom of your page why because it will not make impact on page loading.
When you keep your javascript code in the <head>. User will see a blank page unless the full javascript code runs. So this creates a bad user experience.

Explanation by: Yogesh
We can insert javascript code in both head and body section.
But please keep a note that always try to keep javascript code in the bottom of your page why because it will not make impact on page loading.
When you keep your javascript code in the <head>. User will see a blank page unless the full javascript code runs. So this creates a bad user experience.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
187
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Yogesh
Publisher
πŸ“ˆ
96%
Success Rate