//html代码
客服微信:<input type="text" disabled="disabled" value="shaiyukefu" id='val' />
<button id='copy'>复制</button>
//js代码
$(function(){
$("#copy").click(function(){
var text=document.createElement('input');
text.id="webcopyinput";
text.value=$("#val").val();
text.style.position='fixed'
text.style.top="-10000px";
document.body.appendChild(text);
text.focus();
text.setSelectionRange(0,text.value.length);
copied=document.execCommand('Copy');
text.blur();
copied=false
})
})