the HTML page inside the
This tag can be placed anywhere on the page.
Let’s see an example:
Let's write the first program
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>My first program</title> <script> alert('Hello, world!'); </script> </head> <body> my first program </body> </html>
Copy the above code and insert it in an HTML file. Open this file in a browser and you will see a dialog box with text.
Let's analyze the program code
Let's analyze the code of the program we wrote before.
The first concept you need to learn is functions.
Functions allow you to perform certain actions.
In our example, there is a function
that displays text on the screen as a dialog box.
The function consists of a name
(in our case it is
followed by parentheses. In these parentheses,
you should write function parameters.
In our case, the parameter is the text that
is displayed on the screen.
In our case, the function has one parameter, but there can be functions that take multiple parameters. In this case, these parameters are written separated by commas.
In the future, I will not describe how to connect
meaning that you write it in
Taking this note in account, our program will look like this:
Make a file with your first program. Output some text to the screen with it.