title: Reset and clear out Shiny text output using reset button
body: <p>I am creating a calculator that takes multiple inputs and prints the calculation after clicking 'Calculate'.  I also provide a reset button that successfully resets the input values back to their default.  </p>
  
  <p>The reset button should also <strong>clear the previously printed output</strong> (basically I want it to look exactly like it did when you first open the app).  </p>
  
  <p>Below is a simplified and still functioning example of the calculator.</p>
  
  <pre><code>library(shiny)
  library(shinyjs)
  
  
  ui &lt;- fluidPage(
    useShinyjs(),
    div(id="form",
    sidebarLayout(
      sidebarPanel(
        numericInput("x","X",0),
        numericInput("y","Y",0)
      ),
      mainPanel(
        br(),
        column(width=6,actionButton("calc", "Calculate")),
        column(width=6,actionButton("reset", "Reset")), 
        br(),br(),br(),
        textOutput("sum"))
    )
  ))
  
  
  # Define the server logic
  server &lt;- function(input, output) {
    output$sum &lt;- renderText({
      req(input$calc)
      isolate(paste("X + Y =", input$x + input$y))
    })
  
    observeEvent(input$reset, {
      reset("form")
        })
  }
  
  # Run the application
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>I have tried a few approaches offered on here for other, seemingly similar questions but I haven't managed to get them to work.  I would offer some examples of what I've done but I've lost track of them at this point and I'm hoping there's just some obvious, simple answer that I've overlooked.  I'm fairly new to Shiny, though, so details of why a possible answer works would also be appreciated!</p>