将selectInput传递给html标记

时间:2017-12-11 16:12:37

标签: javascript html r shiny

我有一个html标记tags$a(href='mailto:email@helloWorld.com?subject=myReport&body=practice level = input$pe', "Click here!"),我想在我的标记中传递输入$ pe。但是现在,我只是得到原始文本。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:3)

您可以使用paste0:

tags$a(paste0("href='mailto:email@helloWorld.com?subject=myReport&body=practice level = ", input$pe,"'"), "Click here!")

如果input$pe = abc

<a>
  href='mailto:email@helloWorld.com?subject=myReport&amp;body=practice level = abc'
  Click here!
</a>