100左右的口红的牌子:点按钮怎样复制当前网址,怎样刷新当前页?

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 22:13:26
现在有这么一个按钮,点一下可以把当前网址复制下来,
第二个按钮是刷新当前页
请问这两段代码怎么写?

<script language="javascript">
function copy()
{
document.getElementById("input1").value=parent.location.href;
document.getElementById("input1").select();
document.execCommand("copy")
}
</script>
<input id="input1" type="text" style="width:0;height:0;" value="">
<input type="button" onclick="copy()" value="复制">
<input type=button value=刷新 onclick="window.location.reload()">