Part 1—Create a body script
Now add JavaScript to the body of your HTML page:
- Open lab05.html in NotePad++.
- Save the file as body.html.
- Change the title of your page to "Body Script by " and your name; for example, "Body Script by Joy."
- After the start <body> tag, add some more content to the body section that will show on the screen. Add an <h1> heading and a paragraph.
- After the paragraph, add 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 body script!");
</script>
- Save the file again.
Next, you'll compare the two scripts....
|
|