Dambo Dambo - 3 months ago 12
R Question

How to specify an attribute with a dash in a tag function?

I need to specify an attribute

data-*
in a
div
tag, how to I do it?
I tried something like this but it doesn't work:

tags$div(id='log', data-log='value')

Answer

Quoting the attribute would work!

tags$div(id='log',class='unique','data-log'='next')

Output (Html source):

<div class="col-sm-8">
        <div id="distPlot" class="shiny-plot-output" style="width: 100% ; height: 400px"></div>
        <div id="log" class="unique" data-log="next"></div>
      </div>
Comments