mercredi 7 décembre 2016

Copying text to clipboard isn't working for multiple records

enter image description here In the image above is what i'm trying to do....i need the ip copied to clipboard when the user clicks the button but everytime i click any of the buttons assosciated with each ip, only the 1st IP gets copied whereas i want to copy the ip that is next to the button.....

Here's my code:

    @foreach ($name as $card)
    <li class="list-group-item"><span id="copy2"></span> |  | 
        <button class="btn btn-success btn-xs" data-clipboard-target="#copy2">Copy IP</button>
    </li>
@endforeach

Everytime only the first ip gets copied....If someone can help me or tell me another way of making it happen ,i'll appreciate it....Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire