Chcę skopiować adres email po kliknięciu w diva. Div ma clipboard image w tle. Tekst jest obok po lewej jako podpis. <div>Jakiś tekst email</div><div>Zdjęcie w tle i inne style</div>
<script>
function myFunction() {
/* Get the text field */
var myString = "example@example.pl"
var copyText = document.getElementById(myString);
/* Select the text field */
copyText.select();
document.execCommand(myString);
/* Alert the copied text */
alert("Adres email został skopiowany do schowka: " + copyText.value);
}
</script>