Week 1: Exercise 1 (p.30)

Alert Box: Using Javascript to display a simple alert box when the page loads.

The script uses the Javascript alert(); function to generate an alert box displaying the message we gave it as an argument. "Hello world" is a programmers joke - it is the traditional first message used when learning a new code language.

Notes:


See the code:

<!-- Display an alert box with Javascript. -->
<script>
  alert("Hello world");
</script>