# NOT RUN {
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
useShinyjs(), # Set up shinyjs
actionButton("btn", "Click me"),
textInput("element", "Watch what happens to me")
),
server = function(input, output) {
observeEvent(input$btn, {
# Run a simply shinyjs function
toggle("element")
})
}
)
}
# }
Run the code above in your browser using DataLab