<!DOCTYPE html>
<meta charset="utf8">
<body>
<h1>Nros pares hasta 100</h1>
<form id="formulario" action="" style="display: flex; flex-direction: column; width: 50%;">
<input type="text" value="Todos los nros de 0 a 100 pares" id="numero" readonly>
<button type="submit" onclick="ver()">Consultar!</button>
</form>
</body>
<script>
function ver() {
var nro = 0;
while (nro <= 100) {
if (nro % 2 == 0) {
document.write(nro + " - ");
}
nro = nro + 1 ;
}
}
</script>