The Code
The code is structured in three functions
function getValues()
This function fetches the user's input.
function reverseAString()
This function takes the user's input gathered in the previous function and uses a for loop to reverse the string.
function displayResults()
This function displays the reversed string on the page for the user to see. It also removes the invisible class from the alert so that the information will be displayed on the page nicely.