-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy.html
53 lines (45 loc) · 1.22 KB
/
copy.html
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<body>
<input type="text" value="vendor/bin/phpunit tests --colors=always" id="input1">
<button onclick="myFunction(id1)">Copy text</button>
<br>
<br>
<br>
<input type="text" value="cd C:\laragon\www\crm\src\cache" id="input2">
<button onclick="myFunction(id2)">Copy text</button>
<br>
<br>
<br>
<input type="text" value=".\test.ps1" id="input3">
<button onclick="myFunction(id3)">Copy text</button>
<br>
<br>
<br>
<input type="text" value="git config user.name 'alexmyddleware'" id="input4">
<button onclick="myFunction(id4)">Copy text</button>
<br>
<br>
<br>
<input type="text" value="git config user.email 'alexistroitzky@myddleware.com'" id="input5">
<button onclick="myFunction(id5)">Copy text</button>
<script>
id1 = "input1";
id2 = "input2";
id3 = "input3";
id3 = "input4";
id3 = "input5";
function myFunction(id) {
/* Get the text field */
var copyText = document.getElementById(id);
/* Select the text field */
copyText.select();
copyText.setSelectionRange(0, 99999); /* For mobile devices */
/* Copy the text inside the text field */
navigator.clipboard.writeText(copyText.value);
/* Alert the copied text */
// alert("Copied the text: " + copyText.value);
}
</script>
</body>
</html>