while.html: print i,i**2 up to n

<script>
    var n = prompt("Enter number")
    while (n != null) {
        i = 0
        while (i <= n) {
            document.write("<br>" + i + " " + i*i)
            i = i + 1
        }
    	n = prompt("Enter number")
    }
</script>