button copy javascript
var copyTextarea = document.getElementById("someTextAreaToCopy");
copyTextarea.select(); //select the text area
document.execCommand("copy"); //copy to clipboard<!DOCTYPE html>
<html>
<head>
<script>
function paste() {
var pasteText = document.querySelector("#text");
pasteText.focus();
document.execCommand("paste");
pasteText.value = pasteText.value + pasteText.value;
}
</script>
</head>
<body>
<input id="text">
<button onclick="paste()">Paste</button>
</body>
Also in JavaScript:
- get first element of array javascript
- ioredis cluster example
- auto refresh page javascript
- mobile number format (xxx) xxx-xxxx
- badlion client
- jsx full form
- anime.js morph svg d value
- RFC8259 json
- creating a nested loop of a chessboard in javascript
- make string json object vue
- js select option value when selected
- simple return data jquery
- js window resize listener
- node js to check 32 bit
- openssl error Subject does not start with '/'
- vue dynamic create watch
- push javascript
- not equal to sign in js
- rotate a div using javascript
- node check if file exists
- send data from form to another page angular
- react native multiple touchableopacity
- javascript set input field value
- detect if user is online react