Skip to content

Instantly share code, notes, and snippets.

@Microsofttechies
Created September 2, 2014 20:36
Closing Current tab using javascript
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function CloseWindow() {
window.opener = self;
window.close();
}
</script>
</head>
<body>
<a href='javascript:CloseWindow();'>Click here to Close</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment