HTML Bug Hunt Hard +35 XP
Broken Script Load
The script runs before the DOM is ready.
HTMLFind the bug
1
<head>2
<script src="app.js"></script>3
</head> The bug is on line 2
Select the correct fix
Show answer and explanation
Answer: Both A and B are valid fixes
defer makes the script execute after HTML parsing. Placing scripts at the end of <body> has the same effect.
Hint: Scripts in <head> block HTML parsing.
What this challenge tests
Bug Hunt in HTML: scripts, performance.