<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="">
<meta name="description" content="">
<title>ГГ</title>
<style>
*{
margin:0;
padding:0;
outline: 0;
}
input[type='text'] {
margin:20px;
display: inline-block;
}
input[type='button'] {
width: 250px;
height: 120px;
display: block;
margin-left: 20px;
}
textarea {
margin:20px;
display: block;
}
</style>
</head>
<body>
<input type="text" class="first">
<input type="text" class="second">
<input type="button" class="calculate" value = 'Вывести результат'>
<textarea cols="30" rows="10"></textarea>
<script>
var textarea = document.querySelector('textarea');
document.querySelector('.calculate').addEventListener('click', function(){
textarea.value = '';
var firstValue= document.querySelector('.first').value;
var secondValue= document.querySelector('.second').value;
console.log(firstValue);
console.log(secondValue);
while (+firstValue <= +secondValue) {
textarea.value += firstValue + ' ';
firstValue++;
}
});
</script>
</body>
</html>