The first chapter of the JavaScript Learning guide Hello javascript! Getting started with the most basic JavaScript

Source: Internet
Author: User
Tags button type

JavaScript Learning Guide Notes

First chapter Hello javascript!

Introduction to JavaScript

    1. JavaScript belongs to the scripting language on the network side .

    2. JavaScript is used by millions of of pages to improve design, verify forms, detect browsers, create cookies, and more.

    3. The ability to integrate seamlessly with Web pages. 、

    4. Currently in the Internet field, is also a more popular scripting language.

    5. JavaScript is a lightweight programming language .

    6. JavaScript is a programmatic code that can be inserted into an HTML page.

    7. When JavaScript is inserted into an HTML page, it can be performed by all browsers.

    8. Of these, JavaScript is not required to install any additional software, nor to configure the path of components and so on these tedious processes! It is very different from the development of Java and Android, because in these development process, you need to build the development environment and development platform so that user experience development problems and so on!


The script in the HTML must be between the <script> and </script> tags.

The script can be placed in the <body> and


<! DOCTYPE Html>



For the above code, we do not need to understand that the browser interprets and executes JavaScript between <script> and </script>.


Put JavaScript at the bottom of the page code so you can ensure that the script is executed after the <p> element is created.



Functions and events for JavaScript

We need to execute code when an event occurs, such as when the user taps the button.

If we put JavaScript code in a function, we can call it when the event occurs.


JavaScript in

You can put an unlimited number of scripts in the HTML document.

The script can be in the <body> or

It is common practice to put functions in the


JavaScript functions in


<! DOCTYPE html>


External JavaScript


You can also save the script to an external file. External files typically contain code that is used by multiple Web pages.

The file name extension for external JavaScript files is. js.

To use an external file, set the. js file in the "src" attribute of the <script> tag



<! DOCTYPE html>



It is possible to refer to a script file in


This article is from the "Sun nuo" blog, please be sure to keep this source http://10479756.blog.51cto.com/10469756/1917893

The first chapter of the JavaScript Learning guide Hello javascript! Getting started with the most basic JavaScript

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.