<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Copy Text Example (Fixed)</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; padding: 50px; }
.copy-btn { padding: 10px 20px; background-color: #007BFF; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 1.1em; }
.copy-btn:hover { background-color: #0056b3; }
textarea { width: 300px; height: 50px; }
.hi{background-color: #007BFF; color: white; border:1px white}
.hi:hover{background-color: #0056b3;}
</style>
</head>
<body>
<center><input type="color" id="a"></center>
<button class="hi" onclick="hi()" id="b">
Change Background color
</button>
<textarea id="textToCopy" style="width0px" >
</textarea><br>
<button class="copy-btn" onclick="copyText()">Copy Text</button>
<script>
function copyText() {
var textArea = document.getElementById("textToCopy");
textArea.select();
document.execCommand("copy");
alert("Text copied: " + textArea.value);
}
function hi(){
let a = document.getElementById("a").value
document.body.style.backgroundColor = a
}
</script>
</body>
</html>