day02-01
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js快速引入</title>
<!-- 内部脚本-->
<!-- <script>-->
<!-- alert('Hello JS')-->
<!-- </script>-->
<!-- 外部脚本-->
<script src="demo.js"></script>
</head>
<body>
</body>
</html>
alert('Hello JS');
day02-03
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js-基本语法</title>
</head>
<body>
<script>
// alert("js");
window.alert("hello js");
document.write("hello");
console.log("hello,js");
</script>
</body>
</html>
day02-04
day02-05
parseInr 将其他类型转化成数字
NaN 是指违背定义的数字
day02-06
day02-07访问: console.log(arr[ ])(在控制台显示)
day02-08
substring中是含头不含尾 意思就是结束索引要加一
day02-09
json中必须要用双引号day02-10
confirm 有返回值 ture和false
day02-11
day02-13
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<input type="button" id="btn1" value="事件绑定1" onclick="on()">
<input type="button" id="btn2" value="事件绑定2" >
</body>
<script>
function on(){
alert("按钮一被点击了。。。");
}
document.getElementById('btn2').onclick = function (){
alert("按钮二被点击了。。。");
}
</script>
</html>
day02-15
day02-16
没有声明的话,会报错
day02-17
day02-19