
Last chance! 50% off unlimited learning
Sale ends in
shinyjs
functions to work.useShinyjs()
shinyjs
requires that are automatically inserted
to the app's
tag.runExample
extendShinyjs
if (interactive()) {
shiny::shinyApp(
ui = shiny::fluidPage(
useShinyjs(), # Set up shinyjs
shiny::actionButton("btn", "Click me"),
shiny::p(id = "element", "Watch what happens to me")
),
server = function(input, output, session) {
shiny::observe({
if (input$btn == 0) {
return(NULL)
}
# Run a simply shinyjs function
toggle("element")
})
}
)
}
Run the code above in your browser using DataLab