1function copyToClipboard(text) {
2 const elem = document.createElement('textarea');
3 elem.value = text;
4 document.body.appendChild(elem);
5 elem.select();
6 document.execCommand('copy');
7 document.body.removeChild(elem);
8}
1$(document).ready(function(){
2 $("#ewefmwefmp").click(function(){
3 //alert()
4 var copyText = document.getElementById("myInput");
5 copyText.select();
6 copyText.setSelectionRange(0, 99999)
7 document.execCommand("copy");
8 alert("Copied the text: " + copyText.value);
9
10 });
11});