SoFunction
Updated on 2025-04-13

JavaScript Basic Tutorial (Lesson 1) Page 3/4


JavaScript usually appears between the </title> tag and </head> tag.
Like HTML, JavaScript is text that can be browsed by some word processing software, and it appears in the HTML-related area of ​​the description page. (Although we only looked at JavaScript appears in the header area of ​​the HTML page, it can also exist in the body. You will see it in the example in the next lesson.
JavaScript starts with <script language="JavaScript">.
Now you are not really non-write language="JavaScript" because JavaScript is the default option for all browsers. But sometimes there are exceptions. If you don't bother, you might as well add it.  There are comments that can be ignored between //.
Comments! Comments! ! Comments! ! ! This is a good programming habit, which allows others to understand your language. He is your friend, your colleague, or you three months ago. To make your language three months ago still understand, please comment in /* */ before a large paragraph of text, just like this:
    /* this is 
        a huge block
        of text that I've 
        commented out */ 
alert("better, stronger, faster") - Evokes a simple dialog box where the words "better, stronger, faster" appear.
This is your first Javascript: "Evocation" method.
You will learn more in the next lesson. Until now, you only need to know that you have to end with half</script> and put the "alert" text in the quotes.
JavaScripts ends with the </script> tag.
look! This is as simple as HTML.
Simple? Yes. By the way… In fact, there is a complexity
Previous page1234Next pageRead the full text