myyis
asked on
copy innerHLM of div using clipboardjs
Hi everybody,
I need to copy the content of the div to the desktop when clicked the div using https://clipboardjs.com/
<div id="id1" onclick="copy_content_to_c lipboard(t his);">
Textttttt
</div>
Anybody can help me?
Thank you.
I need to copy the content of the div to the desktop when clicked the div using https://clipboardjs.com/
<div id="id1" onclick="copy_content_to_c
Textttttt
</div>
Anybody can help me?
Thank you.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Hi,
1: thats because the constructor implements the onclick listener.
For an onmouseover you might track that event and fire a click event on the same element. But not sure if this makes sense (from an user perspective).
2: Because they implemented additionally a showTooltip function
HTH
Rainer
1: thats because the constructor implements the onclick listener.
For an onmouseover you might track that event and fire a click event on the same element. But not sure if this makes sense (from an user perspective).
2: Because they implemented additionally a showTooltip function
showTooltip(e.trigger, 'Copied!');
but only on buttons with the class "btn".HTH
Rainer
ASKER
Thank you,
Can you also have a look at this?
https://www.experts-exchange.com/questions/28916699/how-to-simply-copy-text-using-clipboardjs.html
Can you also have a look at this?
https://www.experts-exchange.com/questions/28916699/how-to-simply-copy-text-using-clipboardjs.html
ASKER
1. How is it working for "onclick" without an onclick script, if I want to make it onmouseover, what shall I do?
2. At the examples here https://clipboardjs.com/ when you click the copy button you see a small confirmation pop-up. How can turn this on?