如何用java实现 html 标签的自动补齐
2个回答
2016-09-16 · 知道合伙人软件行家
关注
展开全部
<script language="javascript">
function copyToClipBoard(id){
//var bankName = document.getElementById("yh"+id).innerHTML;
var account = document.getElementById("span"+id).innerHTML;
account = account.replace(" ","");
var index = 0;
while(index != -1){
account = account.replace(" ","");
index = account.indexOf(" ");
}
var clipBoardContent=account;
window.clipboardData.setData("Text",clipBoardContent);
alert("温馨提示:\n\n您已经成功复制该银行账号!\n请直接粘贴到网银转账的收款方管理账号中。");
}
</script>
--------------------------------------------------------------------
<p>银行账号:<span id="span1" onclick="copyToClipBoard(1);">6222 0212 0300 1928 125</span> </p>
<p>银行账号:<span id="span2" onclick="copyToClipBoard(2);">6222 0212 0300 1928 144</span> </p>
<p>银行账号:<span id="span3" onclick="copyToClipBoard(3);">6222 0212 0300 1928 166</span> </p>
function copyToClipBoard(id){
//var bankName = document.getElementById("yh"+id).innerHTML;
var account = document.getElementById("span"+id).innerHTML;
account = account.replace(" ","");
var index = 0;
while(index != -1){
account = account.replace(" ","");
index = account.indexOf(" ");
}
var clipBoardContent=account;
window.clipboardData.setData("Text",clipBoardContent);
alert("温馨提示:\n\n您已经成功复制该银行账号!\n请直接粘贴到网银转账的收款方管理账号中。");
}
</script>
--------------------------------------------------------------------
<p>银行账号:<span id="span1" onclick="copyToClipBoard(1);">6222 0212 0300 1928 125</span> </p>
<p>银行账号:<span id="span2" onclick="copyToClipBoard(2);">6222 0212 0300 1928 144</span> </p>
<p>银行账号:<span id="span3" onclick="copyToClipBoard(3);">6222 0212 0300 1928 166</span> </p>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询