What's to forgive? <script> elements are allowed in the <body> in HTML (although they do still need a type attribute). The only issue might be with accessing the DOM before the page has finished rendering, but that's easy enough to solve by wrapping it with: