Display 1 to 10 in JavaScript

<html>
<body>
<script>
for (var i = 1; i <= 10; i++)
{
document.write(i + "<br>");
}
</script>
</body>
</html>