Click here to Skip to main content
15,890,717 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi ,

I need to close my browser window when i click a button in my site and If is it possible or

Not??,If possible , Please tell me how to close the main window
Posted
Updated 18-Jul-14 20:42pm
v2

 
Share this answer
 
you can do this with - window.close();

write one jQuesry function as:-
SQL
function close_window() {
  if (confirm("Do you want to close Window?")) {
    window.close();
  }
}

and call this function on button click event as:-

onclick="close_window();return false;"
 
Share this answer
 
write one jQuesry function as:-

$(".close").click( function() {
window.close();
});

and call this function as below:-

<a class="close">close</a>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900