显示结果后清除PHP计算器屏幕

I'm making a simple calculator written in HTML, CSS, JS, and PHP. It looks like this:

See Calculator Image Here

I use JS to get the user input and PHP to do the calculations and output the results.

I want to clear the result when the user clicks on any button.

I've tried ob functions in PHP but this prevents any results from showing up in the first place.

I've tried resetting the innerHTML of the div with JS with no luck.

Try something along the lines of creating a variable to indicate a new calculation and using it to clear the screen when a number is pressed.

  1. Do a calculation

  2. Display the answer

  3. newCalculation = true;

  4. Press a number (for the next calculation)

    if(newCalculation == true){
        Clear the screen and display the number 
        newCalculation = false;
    }
    
  5. Press = and display the answer then do it all again.