一,效果图。
二,代码。
<!DOCTYPE html>
<html> <head>
<meta charset="utf-8">
<title>javascript 语法</title>
</head> <body>
<!--JavaScript 字面量-->
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 123e5;
document.getElementById("demo").innerHTML = "John doe";
document.getElementById("demo").innerHTML = 5 * 10;
var length;
length = 6;
document.getElementById("demo").innerHTML = length;
document.getElementById("demo").innerHTML = (5 + 6) * 10;
</script>
</body> </html>