When the button is clicked the page will output the value of x while x is less than 101
<DOCTYPE html>
<html>
<head>
<title> While and Do While Loops</title>
</head>
<body>
<script>
function count()
{
var x = 0;
while(x < 101)
{
document.getElementById('output').innerHTML += (x +"<br/>");
x++;
}
}
</script>
<p id = "output"></p>
<button onclick="count()">Count</button>
</body>
</html>