Tutorials » Javascript tutorials »

Javacript popup objects!

This article explains three important commands of the JavaScript window object

This chapter briefs the window object important functions and their usage.

JavaScript window object

Window Object has several methods and Events that will be used in JavaScript.

An event is something that responds to certain actions or a function.

A method is something that may or may not take arguments but have some functionality defined in it. When the method is called then functionality related to that method is processed. We declare some methods through Javascript and call corresponding methods in the Event. That will be easily understood in the coming chapters.

alert, confirm, prompt


In general what do we mean by the term alert? It’s a kind of attention to something that we are aware or not aware. JavaScript alert is used to display a message box kind of box and show a customized message that is given by the user. Generally it's used to show a user friendly message to the user after certain validation depending on the business logic. We can't change the title bar of the alert box, or OK button that comes with alert box . Clicking on OK it returns nothing, but simply closes the alert box.


JavaScript confirm is a confirmation box mainly used for client side validations such as to warn a user about something such that are ' you sure do you want to proceed' or ‘Are you sure you want to delete the item? ‘etc.

It comes with OK and Cancel buttons. If we click on OK it returns true.If we click on Cancel it returns false.


Javascript prompt is used to allow the user to enter something. We can capture the entered value.

If you are familiar with C programming what I can compare is alert is something like printf and prompt is like scanf.

Next Chapter: More practical Approach
Previous Chapter: More HTML formats in the SCRIPT
More Chapters: Javascript Tutorials
More Tutorials: Tutorial Index

Top Contributors
TodayLast 7 Daysmore...

Awards & Gifts

Online Members

Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India