写一个html代码。A B C三个超级链接a b c 点击A复制a 点击B复制b 点击C复制c
<!DOCTYPE html>
<html>
<head>
<title>Copy Text</title>
<script>
function copyText(text) {
navigator.clipboard.writeText(text).then(function() {
alert("Text copied successfully!");
}, function() {
alert("Unable to copy text!");
});
}
</script>
</head>
<body>
<a href="#" onclick="copyText('a')">A</a>
<a href="#" onclick="copyText('b')">B</a>
<a href="#" onclick="copyText('c')">C</a>
</body>
</html
原文地址: http://www.cveoy.top/t/topic/iKed 著作权归作者所有。请勿转载和采集!