Clipboard.js: Uncaught TypeError: First argument must be a String, HTMLElement, HTMLCollection, or NodeList

Created on 29 Jan 2018  路  4Comments  路  Source: zenorocha/clipboard.js

Receiving the following error:

clipboard.min.js:7 Uncaught TypeError: First argument must be a String, HTMLElement, HTMLCollection, or NodeList
at o (VM96 clipboard.min.js:7)
at e.t (VM96 clipboard.min.js:7)
at new e (VM96 clipboard.min.js:7)
at window.onload ((index):47)

See jsFiddle to reproduce issue:

https://jsfiddle.net/cz5oLjmy/

Most helpful comment

Your btn is null because of wrong ID in getElementById. Remove # ...

All 4 comments

Your btn is null because of wrong ID in getElementById. Remove # ...

This issue can be closed. jQuery syntax used in vanilla js...

No response from originator in a month.

Thanks @Ruffio <3

if you click on svg , add style to svg like this : pointer-events: none; then the error gone !

Was this page helpful?
0 / 5 - 0 ratings