CSE 154 Examples

The Alert Function

Description :

The alert function is used to pop out an alert onto the screen! This is often a great strategy when debugging to know if our JS script is executing. One of the first things to always do if your Javascript isn't working is to have an alert right at the starting of your Javascript. Hence, if your Javascript is properly connected to your page, it'll immediately throw an alert when you refresh.

Syntax to throw an alert (JS) : alert("alert_message");

Exercise :