1. Do you know why JavaScript is worth learning?
- All major browsers support JavaScript.
- JavaScript is currently used on most web pages around the world.
- It can make web pages present various dynamic effects.
- As a web developer, JavaScript is an essential tool if you want to provide beautiful web pages and satisfy users with an online experience.
2. Ease of learning
- The learning environment is everywhere, as long as there is a text editor, you can write JavaScript programs.
- We can use simple commands to complete some basic operations.
3. Where do I start learning?
The starting point of learning JavaScript is to process web pages, so let's first learn the basic syntax and how to use DOM for simple operations.
Task - Exercise 1
Follow the tasks and see what happens to the results window.
1. Insert on the 12th line: document.write("hello");
and see what will happen in the result window.
2. Input in the 13th line: document.getElementById("p1").style.color="blue";
and see what will happen in the result window.
Task Code
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Warm up</title>
</head>
<body>
<p id="p1">I am the first paragraph</p>
<p id="p2">I am the second paragraph</p>
<script type="text/javascript">
</script>
</body>
</html>
//= htmlentities($post["body"]); ?>