The Code

                        
                            // get the user input from the page
                            // Controller function
                            function getValues() {
                            
                                // get the values from the page
                                let count = document.getElementById('count').value;
                                let eliteValue = document.getElementById('eliteValue').value;
                                let codeValue = document.getElementById('codeValue').value;
                            
                                // parse string into ints
                                count = parseInt(count);
                                eliteValue = parseInt(eliteValue);
                                codeValue = parseInt(codeValue);
                            
                                // verify inputs are numbers
                                if (isNaN(count) && isNaN(eliteValue) && isNaN(codeValue)) {
                                    // if they are not, tell our user!
                                    Swal.fire(
                                        {
                                            icon: 'error',
                                            title: 'Oops!',
                                            text: 'Only whole numbers are allowed for FizzBuzz!'
                                        }
                                    );
                                } else if (count > 5000) {
                                    // if the count is greater than 5000, tell our user!
                                    Swal.fire(
                                        {
                                            icon: 'error',
                                            title: 'Oops!',
                                            text: 'Hey pal, I can\'t count that high!'
                                        }
                                    );
                                } else {
                                    // if they are numbers, generate numbers
                                    let elitecodeArray = generateEliteCode(count, eliteValue, codeValue);
                                    // then display them on the page
                                    displayEliteCode(elitecodeArray);
                                }
                            }
                            
                            
                            
                            
                            
                            
                            // generate our numbers
                            // Logic function
                            function generateEliteCode(end, elite, code) {
                            
                                let tableHTML = '';
                            
                                for (let i = 1; i <= end; i++) {
                            
                                    let value=i;
                                    let className='' ;
                            
                                    if (value % (elite * code) ===0 && value != 0) {
                                         value='EliteCode';
                                         className = 'elitecode';
                                    } else if (value % code===0 && value !=0) {
                                        value='Code';
                                        className='code'
                                    } else if (value % elite===0 && value !=0) {
                                        value='Elite';
                                        className='elite';
                                    } if (i % 5===0) {
                                        tableHTML +='';
                                    }
                            
                                    let tableRow = `${value}`;
                                    tableHTML += tableRow;
                            
                                    if ((i + 1) % 5 === 0) {
                                        tableHTML += '';
                                    }
                                }
                            
                                    return tableHTML;
                            }
                            
                            // display them on the page
                            // View function
                            function displayEliteCode(arr) {
                                let tableBody = document.getElementById('results');
                            
                                tableBody.innerHTML = arr;
                            
                            }
                        
                    

The code is structured in three functions with the second one doing the logic that makes FizzBuzz work.

getValues()

This function gets the value from the HTML page that the user has input and assigns them to the variables that first checks that they are in fact numbers, if a non-number is present it will present a Sweet Alert saying that only numbers are allowed, and if the ending number is greater than 5000 it will present a Sweet Alert that it will not accept numbers that big. Then these variables get passed to the logic function.

generateEliteCode()

This function is the logic function it receives the parameters from the getValues function that the user has input and first creates a table in the HTML doc. Then this function performs a for loop that will loop through each number until it gets to the end value, each time it increments by 1. Inside of this for loop it checks each number to see if it's divisable by the "EliteCode" variable, if it is it'll print "EliteCode", if not then it'll check if the number is divisable by the "Code" value, if so it'll print "Code." Lastly, it'll check if the number is divisable by the "Elite" value, if so it'll print "Elite" and if not it will print the number. This will loop through the entire array of numbers.

displayEliteCode()

This function is the display function it receives the parameter "arr" from the getValues function then displays the results in the HTML table.