A function is triggered when the button is clicked. The function outputs the code necessary to get the equation.