Salutations,

Je suis bloqué comme un couillon :

Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(...)
	<?php
        (...)
        $i = 1;
        foreach ($contenu as $liste_fichiers) {
                $inputId = +$i;
                $file5 = "http://admin.wda-fr.org" . $dossier . "/" . $liste_fichiers;
        (...)
                ?>
        (...)
			<td align="center">
				<input hidden="hidden" type="text" id="<? echo $inputId; ?>" value="<?php echo $file5; ?>">
				<button onclick="myFunction('<? echo $inputId; ?>')">Copier l'URL</button>
			</td>
		</tr>
        <?php } ?>
(...)
 
<script>
        function myFunction( id ) {
                var copyText = document.getElementById( id );
                copyText.select();
                document.execCommand("copy");
                alert("URL en copie :\r" + copyText.value);
        }
</script>
 
(...)

copyText.value est bon, mais document.execCommand("copy") reste vide ...

Any idea ?