关注公众号:青山有路

js文本框内容与文本框之外的内容复制

js文本框内容与文本框之外的内容复制

通过一个隐藏域来实现

<input type=”hidden” id=”copydomainurl” value=””>

function copydomainurl(){

var Url2 = document.getElementById(“domperson”);

if(!Url2.value){

layer.msg(“请填写个性域名”);

return false;

}

Url2.value += ‘user.kuleiman.com’;

Url2.select(); // 选择对象

document.execCommand(“Copy”); // 执行浏览器复制命令

var pref = $(“#copydomainurl”).val();

$(“#domperson”).val(pref);

layer.msg(“已复制好,Ctrl+C贴粘即可”);

}


版权所有丨如未注明 , 均为原创 , 转载请注明js文本框内容与文本框之外的内容复制
喜欢 (1)

Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in /www/wwwroot/gaowenjie.cc/wp-content/themes/Git-alpha/comments.php on line 17
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到