copy text to clipboard javascript
//As simple as this
navigator.clipboard.writeText("Hello World");
copy text to clipboard javascript
//As simple as this
navigator.clipboard.writeText("Hello World");
javascript copy to clipboard
<head><script>
function copyToCliBoard() {
var copyText = document.getElementById("myInput");
copyText.select();
copyText.setSelectionRange(0, 99999); /* For mobile devices */
document.execCommand("copy");
alert("Copied the text: " + copyText.value);
}
</script></head>
<body>
<input type="text" value="Hello World" id="myInput">
<button onclick="copyToCliBoard()">Copy text</button>
</body>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us