Let’s see how to insert the Javascript code inside an HTML document. In this article we will explain some important rules and the most basic ways to execute Javascript in the context of a page.
In this part of the we are going to know the most basic way of working with the language. In this article we will give the first information on how to include scripts, mixing the Javascript code itself with the HTML.
Later we will also see how it should be done. Many ideas about the operation of Javascript have already been described in previous chapters, but with the aim of not leaving anything in the dark, we are going to try to capture all the important data of this language from here on.
Javascript is written to the HTML document
The most important and basic thing that we can highlight at this moment is that Javascript programming is done within the HTML document itself. That is, the Javascript code, in most cases, is mixed with the HTML code itself to generate the page.
This means that we must learn to mix the two programming languages and we will quickly see that, so that these two languages can coexist without problems with each other, some delimiters must be included that separate the HTML tags from the Javascript instructions. These delimiters are the tags. All the Javascript code that we put in the page must be inserted between these two tags.
Script placement does matter
On the same page we can introduce several scripts, each one that could be introduced within different
When the user clicks OK in the dialog, the browser will display the full page.