<pre name="code" class="html">点击button 复制input里面的内容
<input type="text" id="text">
<input type="button" id="button οnclick="copytex">
function copytxt(){
var d = document.getElementById("text");
d.select();
document.execCommand("Copy");
alert("复制成功!");
}