소스 검색

Better way

Piotr Czajkowski 1 주 전
부모
커밋
bffa515c5b
1개의 변경된 파일과 5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      html/result.html

+ 5 - 3
html/result.html

@@ -22,10 +22,12 @@
 			function copyLink() {
   				const copyText = document.getElementById("link");
   				copyText.select();
-  				document.execCommand("copy");
+				navigator.clipboard.writeText(copyText.value)
+				    .then(() => info.textContent = "Copied!")
+				    .catch(err => console.error(err));
 
-				let info = document.getElementById("info");
-				info.textContent = "Copied!";
+				//let info = document.getElementById("info");
+				//info.textContent = "Copied!";
 }
 		</script>