JavaScript Tutorial


JavaScript is the programming language of the web.

All modern HTML pages use JavaScript.

JavaScript is very easy to learn.

This tutorial will teach you to learn JavaScript knowledge from beginner to advanced.

JavaScript Online Examples

This tutorial contains a large number of JavaScript examples. You can click "Try it" to view the examples online.

Instance

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文网(php.cn)</title>
<script>
function displayDate(){
	document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>

<h1>我的第一个 JavaScript 程序</h1>
<p id="demo">这是一个段落</p>

<button type="button" onclick="displayDate()">显示日期</button>

</body>
</html>

Run Instance»

Click the "Run Instance" button to view the online instance

On each page you can click "Try it" to view examples online! ! !

Try each instance and modify the code online to see different running effects! ! !

Note#If you can learn step by step based on the examples on this site, you will learn JavaScript in a very short time.

Why learn JavaScript?

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

  1. HTML Defines the content of the web page

  2. CSS Describes the layout of the web page

  3. JavaScript Behavior

This tutorial is about JavaScript and how it works with HTML and CSS.


Who is suitable to read this tutorial?

1. If you want to learn JavaScript, you can follow this tutorial:

Learn how JavaScript works with HTML and CSS work.

2. If you have used JavaScript before, you can also read this tutorial:

JavaScript is always being upgraded, so we need to always understand new technologies in JavaScript.


What you need to know before reading this tutorial:

To read this tutorial, you need to have the following basics:

  • HTML and CSS Basics

If you want to learn these basic knowledge, you can find the corresponding tutorial on our homepage php Chinese website.


JavaScript Examples

Learn over 100 JavaScript examples!

In the examples page, you can click "Try it" to view JavaScript online examples.

  • JavaScript Instance

  • JavaScript Object Instance

  • JavaScript Browser Support Instance

  • JavaScript HTML DOM Example


JavaScript Quiz

Test your JavaScript skills in php Chinese website!


JavaScript Reference Manual

In the PHP Chinese website, we provide you with a complete reference manual for JavaScript objects, browser objects, and HTML DOM objects.

The following manual contains examples of each object, property, and method.

  • JavaScript built-in object

  • Browser object

  • HTML DOM object