js关闭当前窗口、标签页
1、通过a
标签
<a href="javascript:window.opener=null;window.open('','_self');window.close();">关闭当前窗口</a>
2、通过按钮
<body>
<button id="btn">关闭当前窗口</button>
</body>
<script>
document.getElementById('btn').onclick = function() {
window.opener = null
window.close()
}
</script>