# NOT RUN {
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
useShinyjs(), # Set up shinyjs
actionButton("btn", "Click me"),
disabled(
textInput("element", NULL, "I was born disabled")
)
),
server = function(input, output) {
observeEvent(input$btn, {
enable("element")
})
}
)
}
library(shiny)
disabled(numericInput("num", NULL, 5), dateInput("date", NULL))
# }
Run the code above in your browser using DataLab