Getting Started with JAVASCRITP: writing a simple JavaScript program

Source: Internet
Author: User

Core Tip: write the first JavaScript program that explains how JavaScript scripts are embedded in HTML documents.

Let's use an example to write the first JavaScript program.

It shows how JavaScript scripts are embedded in HTML documents. test1.html Documents:

<ptml> <pead> </Head> </Html>

Figure 1-1 Results of the program running

Description

Test1.html is an HTML document whose identity format is in standard HTML format;

Like the HTML markup Language, JavaScript code is the text that is browsed by some word processing software that appears in the HTML-related area of the description page.

JavaScript code consists of <script Language = "JavaScript" >...</Script> description. JavaScript scripts can be added between the identity <script Language = "JavaScript" >...</Script> .

Alert () is a JavaScript window object method that pops up a string with the OK dialog box and displays ().

 

Through the <!--...//--> identification Note: If you do not know the JavaScript code browser, all the tags in it are ignored, if you know, then execute its results. Using annotations This is a good programming habit that makes it possible for others to read your language.

  

JavaScript ends with a </Script> tag.

From the above example analysis, we can see that writing a JavaScript program is really very easy

-->

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.