The Code for REWIND
The Code is structured in three functions.
getValue
getValue is a function that accesses the string entered by the user. This is achieved with DOM manipulation technique such as getElementById to directly retrieve the user input. The extracted string is passed is then passed to two other functions responsible for reversing the string and displaying the reversed string respectively.
reverseString
reverseString is a function that handles the logic aspect of the application (so they would say in the informatiom systems world, okay, back to our code).
This is where all the operations of reversing the string happen. Using a for loop to decrement from the last character of the string to the first character, all character are then added to another string (newString) to form a new reversed string. The reversed string is then returned.
displayString
dislayString function does exactly that, display the string but now reversed. This is achieved by innerHTML to send reversed string to an element with id of "msg".
Last two lines of code toggle the visibility of message box on the page.