Make your own free website on

[an error occurred while processing this directive]

Site Menu

Learn all about HTML, how to format text, add images, create tables, meta taga, and more!
Get the low down on JavaScript. See how to create popular JavaScript applications like drop down menus, clocks, dynamic messages, popup boxes, and more.
Concise, easy to follow introdction to CGI and how to install CGI scripts.
Web Design
A miscellanous section that includes various web design tutorials


123 Web Design!

JavaScript dialog boxes

So, what the heck are JavaScript dialog boxes? Well, they are interesting little "pop-up" boxes that can be used to display a message, ask for confirmation, user input etc. They're very easy to create, not to mention cool!

Three types of dialog boxes exist in JavaScript- alert, confirm, and prompt. I'll show you an example of each:


alert("Welcome, my friend!")



var answer=confirm("Jump to CNN?")
if (answer)



var answer=prompt("Please enter your name")
alert("Hello "+answer)


All of the boxes allow you to customize the message simply by entering in a different text inside the function's parentheses. Go ahead, try it now on your web page!