Q. Where is the right place to insert JavaScript code?
β
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.