You are on page 1of 10

JavaScript

Chapter 5
Events and
Popup Boxes
Lesson 2
What are events?

Events are actions that are triggered


either by mouse click, function calls,
keyboard strokes, loading images,
submitting an HTML form, etc.
Popup Boxes

Popup boxes are those windows that


pop-out of your screen. They could be
before a page is fully loaded, effect of an
event on a page or before leaving a page.
Alert Box

alert (“message”);
Syntax for alert boxes
Example using alert box
Prompt Box

prompt(“message”,“defaultvalue”);
Syntax for prompt boxes
Example using prompt box
Confirm box

confirm(“message”);
Syntax for confirm boxes
Example using confirm box

You might also like