![84f53a5c8e296d9cf51105a54ba33f93.png](https://img-blog.csdnimg.cn/img_convert/84f53a5c8e296d9cf51105a54ba33f93.png)
第一种实现方式
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>测试手机复制功能</title>
</head>
<body>
<div>
<label>卡号:</label>
<input type="text" size="20" name="IDCard" id="IDCard">
<span class="copy" onClick="copy('IDCard')">复制</span>
</div>
<div>
<label>用户名:</label>
<input type="text" size="20" name="IDUserName" id="IDUserName">
<span class="copy" onClick="copy('IDUserName')">复制</span>
</div>
<script type="text/j