remove text post clicking the button

hi all, below is my reprex. Post clicking the upload button, the text appears. Upon clicking the clear button the text should go off. Wanted to check the way to do this. Can anyone help me here.

---
title: "Untitled"
runtime : shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
code <- "This is code"
```

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
actionButton("upload","Upload",width = 150)
actionButton("clear_upload","Clear",width = 150)
verbatimTextOutput("code")
   get_code <- eventReactive(input$upload,{
     code
   })
  
   output$code <- renderPrint(
     get_code()
   )
```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.