Difficulty: Moderately Challenging
One Type of Code
Step1
Find the tag in the code of your Web page. It should be toward the top of the code.
Step2
Move the tag down one line on your code. If the tag is on a line with other code, move it to its own line and then move it down another line.
Step3
Insert the following code on the line above the tag.
The code between the tags is the code you’re going to call from within your Web page. This way, you can have many functions at the top of your Web page and call them all as you need them. The code we’ve used will, when "talktome" is invoked, pop up an alert box saying "I love it when you talk to me."
Another Easy Code
Step2
Save your file as "talk.html."
Step3
Open "talk.html" in your Web browser.
Step4
Click on "Click me to make me speak." Note how the box pops up with the text we told the "alert" command to output.
Your final code should look something like this:
Click me to make me speak