I'm trying to create a button that when clicked will copy a text to clipboard.
<button onclick="copyToClipboard('A\B\C\D')">Click here</button>
but when using this approach, the text copied to the clipboard is:
ABCD
instead of
A\B\C\D
Can someone help here please?