2
Has a page element (attr) I want to copy to clipboard (Ctrl+C) automatically whenever I enter it. I have already been able to find it with Jquery. On the page it’s like this:
<div class="image-constrain js-image-wrap image-constrain_zoommed">
<img class="image__pic js-image-pic" src="https://ig.img.com/image/E0SlHdTiS-SLAGDD3o3aOw.png" alt="" id="screenshot-image" image-id="gqgn5p">
</div>
In the script it’s like this:
var divACopiar = $('.image-constrain').find('img').attr('src');
Put to display on console it shows like this:
https://ig.img.com/image/E0SlHdTiS-SLAGDD3o3aOw.png
I just couldn’t find commands that would work for my need, even here in community responses.
+1. However... this type of concealment may be considered an attack and will eventually be prohibited by the browsers, so be advised to those who implement. It is recommended to make it clear to the user what will be copied to the clipboard. Other than that, perfect response.
– Oralista de Sistemas
That’s what I was looking for, Wictor! Very good! Thanks for the clarifications, guys!!! And aware of the risk @Renan. ;)
– GOliveira