Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
Diferencia entre escribir código JS/HTML en un archivo .HTML y shiny

Cuando escribo el siguiente código en .html y lo ejecuto, funciona bien

 <h1>Change the HTML content</h1> <h2 id="hcontent">Hello Manu</h2> <h3>Welcome</h3> <button type="button" onclick="document.getElementById('hcontent').innerHTML='Hello Mr. Manu'">Click here</button>

Pero, cuando escribo lo mismo en shiny, no lo hace. ¿Alguien puede ayudarme sobre cómo ejecutarlo?

 library(shiny) library(shinyjs) # source("myfun.R") ui <- fluidPage( useShinyjs(), tags$head(HTML("<h1> Chnge the html content </h1> <h2 id = 'hcontent'> Hello Vinay </h2> <h3> Welcome </h3> <button type = 'button' onclick='document.getElementById('hcontent').innerHTML='Hello Mr Vinay'>Click here </button>")) ) server <- function(input, output, session) { } shinyApp(ui, server)
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

El problema eran las comillas. Prueba lo siguiente

 HTML("<h1>Change the HTML content</h1> <h2 id=\"hcontent\">Hello Vinay</h2> <h3>Welcome</h3> <button type=\"button\" onclick='document.getElementById(\"hcontent\").innerHTML=\"Hello Mr. Vinay\"'>Click here</button>") )

No use tags$head() porque eso colocará el código en la etiqueta <head>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda