Now we'll add some
Javascript and
define that
function.
As you know, Javascript exists inside a <script> tag.
<script>
function DoMyThing() {
alert("I got clicked");
}
</script>
We can put the script tag
pretty much anywhere we like. But remember:
- inside the script tag, the language is Javascript, not HTML
- outside the tag, the language is HTML, not Javascript.
Our function is just going to display an "alert box", so we know it's working.
Try clicking the button.
When the alert flashes up, if your browser includes an option similar to "don't display this dialog ever again", be sure not to select it !