Realized that the button does not have the text as a value but as innerHTML. Changed the innerHTML onClick now.