Bem-vindo ao JavaScript Tutorial
Previous topic/Tópico anterior
Next topic/Próximo tópico
02 - Where do I put the JavaScript code?

Show where to put the JavaScript code inside an HTML code.


The JavaScript code lies between the <script> and the </script> tags.
It will look like the following:

<html>
<body>

<script>

alert("My first message!")

</script>

</body>
</html>
Phew! Our first code. Let's analyze-it?

Understanding the code:

alert("My first message!")
Shows a window with the My first message phrase and an OK button. Test it yourself, create a file with a .htm extension and run it.

There are three more different ways to put the JavaScript code on your page, but we will be using the method above in our tutorial.

Previous topic/Tópico anterior
Next topic/Próximo tópico
[ Voltar ]


© 2005 JavaScript Tutorial Brasil
Proibida a cópia ou distribuição integral ou parcial não-autorizada
Unauthorized integral or partial distribution or reproduction is forbidden
Patrocínio - Assistência Técnica de Calculadoras HP CSCenter