Part 1—Create a header script
Now add a JavaScript to the head of your HTML page:
- Open lab05.html in NotePad++.
- Save the file as header.html.
- Change the title of your page to "Header Script by " and your name; for example, "Header Script by Joy."
- After the end </title> tag, add your script tags so the Web browser knows it's JavaScript. Between the script tags, add an alert that will pop up with a message to the user. The message is in quotes.
<script type="text/javascript">
alert("This script is a header script!");
</script>
- Go down to the <body> section of the HTML page. After the start <body> tag, add some content that will show on the screen. Add an <h1> heading and a paragraph.
- Save the file again.
Next, you'll create a body script and compare the two.
|
|