1//U need to have a button with the id the same as its name because it is going to be sent to the clipborad.
2/*Like this: */
3<button onClick="SelfCopy(this.id)" id="1">1</button>
4<button onClick="SelfCopy(this.id)" id="2">2</button>
5<button onClick="SelfCopy(this.id)" id="3">3</button>
6
7function SelfCopy(copyText)
8 {
9 navigator.clipboard.writeText(copyText);
10 alert("You just copied this: (" + copyText + ").");
11 }