Home > Web Front-end > JS Tutorial > JavaScript Basics Study Notes_Basic Knowledge

JavaScript Basics Study Notes_Basic Knowledge

WBOY
Release: 2016-05-16 16:29:41
Original
1435 people have browsed it

Introduction to JavaScript

1. Definition : JavaScript is a scripting language that requires a host file, and its host file is an html file.

JavaScript is a lightweight programming language.

JavaScript is programming code that can be inserted into HTML pages.

JavaScript, when inserted into an HTML page, can be executed by all modern browsers.

2. Usage :

has three positions in html:
1) Inside the head;
2) Inside the body;
3) After , it is usually written after for the sake of safety. .

1. Write html output

2. Respond to events

3. Find elements and change content/style

4. Define a variable group - equivalent to a structure (a collection of variables) in C#

<script>The code can be written in <head> or after </html>. But the connection <input> submitted by the button must be written in <body>. </p> <p><img alt="" src="http://files.jb51.net/file_images/article/201412/2014120209122911.png"></p> <p>5. How to call external JS</p> <p>Click "File"--New "JavaScript"--"Create". Write operations, functions, etc. in the newly created "JavaScript" and call them in html. </p> <p>Format: <script src="path.JS "></script>

Create a new external file with the suffix Js.

Reference external Js in the host file html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template