ph-to-clipboard attribute

Copy the content of the selector to Clipboard.

<textarea id="textarea-to-clipboard" style="width:100%;">To Clipboard</textarea>
<button ph-to-clipboard="#textarea-to-clipboard">click to copy</button>

copy innerhtml

Hello

World

<div id="innerhtml-to-copy">
<p>Hello</p>
<p>World</p>
</div>
<button class="btn" type="button" ph-to-clipboard="#innerhtml-to-copy">click to copy</button>

copy self

Hello,World

<p id="self-to-copy" ph-to-clipboard>Hello,World</p>

extra attributes for this helper:

name description link
ph-no-copied-message suspend the copied message.  

Back to top

Discord, QQ group:418474680