1.1.6 • Published 5 months ago
@saekitominaga/customelements-button-clipboard v1.1.6
Clipboard write text button
Demo
Examples
<button type="button" is="x-clipboard"
data-text="Text"
>Copy</button>
<p id="clipboard-target">Text</p><!-- Target element: If the `data-target-for` attribute exists, write the contents of this element (Node.textContent or HTMLXXXElement.value or HTMLMetaElement.content) to the clipboard. -->
<button type="button" is="x-clipboard"
data-target-for="clipboard-target"
data-feedback-for="clipboard-feedback"
>Copy</button>
<p id="clipboard-feedback" hidden=""></p><!-- Feedback element: It will be displayed when writing to the clipboard is done. -->