Close without prompting

<a href="javascript:window.opener=null; window.open('','_self'); window.close();" > close < / a >Copy the code

Customize the prompt content

<script language="javascript"> function custom_close(){if (confirm(" Are you sure you want to close this page?" )){ window.opener=null; window.open('','_self'); window.close(); </script> <input id="btnClose" type="button" value=" close "onClick="custom_close()" />Copy the code