I’m on “The sum of a range” exercise and have spent this last 12 hours trying to figure it out. Here is what I have:
<head>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<form action="/action_page.php">
Min: <input type="text" id="min"><br>
Max: <input type="text" id="max"><br>
Step: <input type="text" id="Step"><br>
<input type="submit" value="Submit" id="submit">
</form>
<script>
var numbers;
var min;
var max;
var step;
function getAllNumbersBetween(x, y) {
for (var i = x; i < y; i = i + step) {
numbers.push(i);
}
}
$("#submit").click(function(){
min = $('#min').val();
max = $('#max').val();
step = $('#Step').val();
numbers = [];
getAllNumbersBetween(min, max)
console.log(numbers);
});
</script>
</body>
</html>
I have tried several different ways of manipulating the code but they all still come back not working. Could someone help me?