thecynicality
Technical User
How can i make a input or other type of button to copy a certain text when pressed?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<script>
function copyval(){
document.getElementById("text2").value = document.getElementById("text1").value;
}
</script>
</head>
<body>
<form id="myform">
<input type="text" id="text1" value="">
<input type="text" id="text2" value="">
</form>
<button onclick="copyval();">copy</button>
</body>
</html>