title: clipboard.js in Shiny application
body: <p>I am trying to copy to the clipboard 'Clipboard copied !' when a button is clicked using <a href="https://clipboardjs.com/" rel="nofollow noreferrer">clipboard.js</a>.</p>
  <p>Nothing is copied, with the JS error: <code>Uncaught TypeError: Cannot read property 'addEventListener' of null</code>.</p>
  <pre class="lang-r prettyprint-override"><code>library(shiny.semantic)
  
  ui &lt;- semanticPage(
      tags$head(
          tags$script(src = &quot;https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js&quot;),
          tags$script(HTML(&quot;new ClipboardJS('.clipboardButton');&quot;))
      ),
      
      action_button(input_id=&quot;myButton&quot;,
                    class = &quot;clipboardButton&quot;,
                    label = &quot;Click Me !&quot;,
                    `data-clipboard-text` = &quot;Clipboard copied !&quot;
      ),
      text_input(&quot;text&quot;,
                 placeholder=&quot;paste here to check&quot;
      )
  )
  
  server &lt;- function(input, output, session){}
  
  shinyApp(ui, server)
  </code></pre>