Sure enough, there will always be learning problem, write a simple html calls for external js file, life and death does not take effect
code show as below
JavaScript:
var x = 7,y = 7,z = 9;
document.getElementById("demo").innerHTML =
(x == y) + "<br>" + (x == z);
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript练习</title>
<script src="../Javascript/0113_08.js"></script>
</head>
<body>
<h2>JavaScript Booleans</h2>
<p>布尔值:true 或 false。</p>
<p id="demo"></p>
</body>
</html>
Two-line display is missing content should be displayed:
js in regard to (x == y) and (x == z) of judging the truth of
thought for a long time, and finally realized that the <script>
question put in the position of, <script>
on <head>
and <body>
in effect is not the same as the
So I html file <script>
has been adjusted position
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript练习</title>
</head>
<body>
<h2>JavaScript Booleans</h2>
<p>布尔值只有两个值:true 或 false。</p>
<p id="demo"></p>
<script src="../Javascript/0113_08.js"></script>
</body>
</html>