Please see my comments the the question and thank you for the clarification:
Khushi Saraswat wrote:
Actually I have a career page there student can apply but there is a progressbar in this interval if it will not fill all details than window will close after alert.
It's hard to invent more
unfriendly, even hostile behavior! Imagine the user's frustration, who maybe filled in most of the data correctly, and, due to one little mistake, you cancel all her/his work. With such aggression against your users, I would rather advise you to rethink your own career. :-)
More generally, even though
window.close()
can really close a browser window in some cases, I cannot see many valid scenarios when it would be acceptable. In your case, you should do something nearly opposite to what you are trying to do: you need to validate the data and mark every invalid item with some content explaining the problem.
Leave all the data entered by the user intact, but disable your "Submit" button. Re-enable it on any change in the entered data. Give the user a chance to change just some of the data and submit again.
—SA