Trying to retrieve the user's input

The onclick method doesnt work, but the function is able to get the user
input for some reason. Looking into this.