This code is structured in three functions.

The first thing done was to add an event listener to the button so the code will fire when the button is pressed.

The next getValues function gets the values from the number input fields, that being the Starting Number and Ending Number fields. It also makes a few checks to see if the numbers entered are valid. Finally it will call on a couple of "helper" functions explained below.

The first helper function is called generateNumbers. This function will generate a list of numbers in between and including the starting and ending numbers and put them into an array to be passed on later.

The second helper function is called displayNumbers. This will take the numbers in the array, put them in some html code, and then inject them into the web page for display.

In summary the getValues function gets the values from the number fields and checks to make sure those inputs are valid, it calls the generateNumbers function to generate the numbers array, then it calls the displayNumbers function to display the array passed on from the generateNumbers function into the web page.

Application Website

Git Repo