THE WORLD'S LARGEST WEB DEVELOPER SITE

JS教程

JS主页 JS简介 JS在哪里 JS输出 JS语句 JS语法 JS评论 JS变量 JS运算符 JS算术 JS分配 JS数据类型 JS函数 JS对象 JS活动 JS字符串 JS字符串方法 JS号 JS编号方法 JS数组 JS数组方法 JS数组排序 JS数组迭代 JS日期 JS日期格式 JS日期获取方法 JS日期设置方法 JS数学 JS 随机 JS布尔值 JS比较 JS条件 JS开关 JS循环 JS循环播放 JS Break JS类型转换 JS运算 JS正则 JS错误 JS范围 JS吊装 JS严格模式 JS此关键字 JS Let JS Const JS箭头功能 JS调试 JS样式指南 JS最佳做法 JS错误 JS性能 JS保留字 JS版本 JS ES5版 JS ES6版 JS JSON

JS表单

JS表单 Forms API

JS对象

对象定义 对象属性 对象方法 对象显示 对象访问器 对象构造器 对象原型 对象ECMAScript 5 Object Classes

JS函数

功能定义 功能参数 函数调用 函数调用 应用功能 功能闭包

JS HTML DOM

DOM简介 DOM方法 DOM文档 DOM元素 DOM HTML DOM CSS DOM动画 DOM事件 DOM事件监听器 DOM导航 DOM节点 DOM集合 DOM节点列表

JS浏览器BOM

JS窗口 JS屏幕 JS位置 JS历史记录 JS导航器 JS弹出警报 JS计时 JS Cookies

JS AJAX

AJAX简介 AJAX XMLHttp AJAX请求 AJAX响应 AJAX XML文件 AJAX PHP AJAX ASP AJAX数据库 AJAX应用程序 AJAX 示例

JS JSON

JSON简介 JSON语法 JSON与XML JSON数据类型 JSON解析 JSON Stringify JSON对象 JSON数组 JSON PHP JSON HTML JSON JSONP

JS Web APIs

Web API Intro Web History API Web Storage API Web Geolocation API

JS vs jQuery

jQuery选择器 jQuery HTML jQuery CSS jQuery DOM

JS 示例

JS 示例 JS HTML DOM JS HTML输入 JS HTML对象 JS HTML事件 JS浏览器 JS编辑器 JS 练习 JS测验 JS证书

JS 参考

JavaScript对象 HTML DOM对象


JavaScript Tutorial

JavaScript is the world's most popular programming language.

JavaScript is the programming language of the Web.

JavaScript is easy to learn.

This tutorial will teach you JavaScript from basic to advanced.

示例 in Each Chapter

With our "来试试吧" editor, you can edit the source code and view the result.

Example

My First JavaScript

来试试吧 »


Use the Menu

We recommend reading this tutorial, in the sequence listed in the menu.

If you have a large screen, the menu will always be present on the left.

If you have a small screen, open the menu by clicking the top menu sign .

Start learning JavaScript now »

Learn by 示例

示例 are better than 1000 words. 示例 are often easier to understand than text explanations.

This tutorial supplements all explanations with clarifying "来试试吧" examples.

If you try all the examples, you will learn a lot about JavaScript, in a very short time!

JavaScript 示例 »

Why Study JavaScript?

JavaScript is one of the 3 languages all web developers must learn:

   1. HTML to define the content of web pages

   2. CSS to specify the layout of web pages

   3. JavaScript to program the behavior of web pages



Learning Speed

In this tutorial, the learning speed is your choice.

Everything is up to you.

If you are struggling, take a break, or re-read the material.

Always make sure you understand all the "Try-it-Yourself" examples.

The only way to become a clever programmer is to: Practice. Practice. Practice. Code. Code. Code !


Test Yourself With 练习

Exercise:

Create a variable called carName and assign the value Volvo to it.

var  = "";

Start the Exercise


Commonly Asked Questions

  • How do I get JavaScript?
  • Where can I download JavaScript?
  • Is JavaScript Free?

You don't have to get or download JavaScript.

JavaScript is already running in your browser on your computer, on your tablet, and on your smart-phone.

JavaScript is free to use for everyone.


JavaScript 参考

W3Schools maintains a complete JavaScript reference, including all HTML and browser objects.

The reference contains examples for all properties, methods and events, and is continuously updated according to the latest web standards.

Complete JavaScript 参考 »

JavaScript 测试 Test

Test your JavaScript skills at W3Schools!

Start JavaScript 测试!


JavaScript Exam - Get Your Diploma!

W3Schools Certification

W3Schools' Online Certification

The perfect solution for professionals who need to balance work, family, and career building.

More than 25 000 certificates already issued!

Get Your 证书 »

The HTML证书 documents your knowledge of HTML.

The CSS证书 documents your knowledge of advanced CSS.

The JavaScript 证书 documents your knowledge of JavaScript and HTML DOM.

The Python 证书 documents your knowledge of Python.

The jQuery证书 documents your knowledge of jQuery.

The SQL证书 documents your knowledge of SQL.

The PHP 证书 documents your knowledge of PHP and MySQL.

The XML 证书 documents your knowledge of XML, XML DOM and XSLT.

The Bootstrap 证书 documents your knowledge of the Bootstrap framework.




W3Schools is optimized for learning, testing, and training. 示例 might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 1999-2020 by Refsnes Data. All Rights Reserved.
Powered by W3.CSS.

W3Schools.com