<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script>
document.write("<h1 stylle='coloe:red'>HELLO</h1!><br>"); //可以把HTML語法寫在write裡面
console.log("HELLO \n Javascrit")//只會顯示在console欄,無法使用HTML語法
var a = 10;//number 只需要宣告為變數,他會自己判斷是哪個資料
document.write("a1=" + a+" ,a1-type ="+typeof(a)+"<br>");
var a = "TEST";//String
document.write("a2=" + a + " ,a2-type =" + typeof (a) + "<br>");
var n = null;//oblect
document.write("n=" + n + " ,n-type =" + typeof (n) + "<br>");
var u;//undefined
document.write("u=" + u + " ,u-type =" + typeof (u) + "<br>");
</script>
<!-- <script src="first.js"></script>--><!--最好種先寫好JS再掛進來的方式,但為了練習暫不使用-->
</head>
<body>
</body>
</html>
留言列表