If you have the foundation for programming, it is easy to learn Javascript. If you do not have the foundation for programming, don't worry. We will explain each line for you. Code.
Copy codeThe Code is as follows: <HTML>
<Body>
<SCRIPT type = "text/JavaScript">
Document. Write ("This is my first JavaScript ");
</SCRIPT>
</Body>
</Html>
We will skip the HTML section. If you do not know HTML, you should first learn it and then learn JavaScript. See our HTML tutorial.
Now return to our code:
Script Type -- define our script type
Text/JavaScript-initialize the script language. After initialization, you can write your Javascript script.
Document. Write ("This is my first JavaScript !"); -- This line of code prints a line of "this is my first JavaScript!" on the screen !"
String.
</SCRIPT> -- Javascript script end mark
Is it easy? You have already compiled your first Javascript script. Please wait for more JavaScript tutorials.