Trying to incorporate JS into shiny

I am trying to incorporate JS into Shiny that is without writing anything to server. Here is the code

library(shiny)

ui <- fluidPage(
  tags$head(HTML('<p id="res">Value</p>'),
  tags$script("document.getElementById('res').innerHTMl=x")),
  textInput("x", label = "Text")
)

server <- function(input, output) {
}

shinyApp(ui, server)

So basically, whatever we write inside the text box, the "Value" should get changed. Can anyone help me?

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.