I don't know why the script doesn't recognize the body
.
My HTML with the script:
<html>
<head>
<script>
document.body.style.overflow="hidden";
</script>
<body>
<table width="2000px" height="1000px">
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
<tr><td></td></tr>
</table>
</body>
The error:
Uncaught TypeError: Cannot read property 'style' of null