<button onclick="getWechatCode()">复制微信号</button>
<script>
function getWechatCode() {
var wechatCode = "zzjianzhan";
var input = document.createElement("input");
input.setAttribute("value", wechatCode);
document.body.appendChild(input);
input.select();
document.execCommand("copy");
document.body.removeChild(input);
alert("已复制微信公众号代码!");
window.location.href='weixin://';
}
</script>
分类: js
移动端实现点击复制微信号并打开微信界面
文章作者:清风
<button onclick="getWechatCode()">复制微信号</button> <script> function getWechatCode......
建站技术分享网
发表评论