76
Chapter 2
Event handlers connect
HTML to JavaScript
Remember event handlers from Chapter 1? You used the onClick
handler to connect a button on an HTML page to a JavaScript
function. Let’s take a quick peek back at Chapter 1:
Remember this? We used
event handlers to connect
the “Show Me the Money”
button in the Boards app to
a JavaScript function.
We need to use one of these
event handlers to connect
the phone number eld to a
JavaScript function.
An event handler connected
this bit of HTML...
...to this JavaScript function.
Man, Break Neck pizza rocks. There’s
nothing like a breakfast of cold pizza, a
whipped latte from Starbuzz, and the
Webville Times to read.
<script>
var request...
function foo()
{
...
}
</script>
JavaScript
<script>
var request...
function foo()
{
...
}
</script>
Customer’s Phone Number
Customer’s Address
Customer’s Order
connecting html to javascript