我是靠谱客的博主 傲娇电灯胆,这篇文章主要介绍8.2 switch循环、创建对象switch循环、创建对象知识总结,现在分享给大家,希望可以做个参考。

switch循环、创建对象

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <h1 id="day"></h1> </body> <script type="text/javascript"> console.log("page loading"); var date = new Date(); var day = date.getDay(); console.log(day); var dayShow = ""; var dayShowArray = new Array(); dayShowArray[0] = "周日"; dayShowArray[1] = "周一"; dayShowArray[2] = "周二"; dayShowArray[3] = "周三"; dayShowArray[4] = "周四"; dayShowArray[5] = "周五"; dayShowArray[6] = "周六"; var dsa = ["周日","周一","周二","周三","周四","周五","周六"]; document.getElementById("day").innerHTML = dsa[day]; </script> </html>

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <h1 id="xx"></h1> <select id="ss" onchange="getProperty(this);"> <option value="name">name</option> <option value="age">age</option> <option value="sex">sex</option> </select> </body> <script type="text/javascript"> var getProperty = function(obj) { var ss = document.getElementById("ss"); alert(lu[obj.value]); } var sum = 0; var zzzz = "abc"; var lu = { name:"abc", age:34, sex:"男", teach:function(){ alert("我在教书"); }, xx:"xx" }; document.getElementById("xx").innerHTML = lu.name; // lu.teach(); var i = 1; while (i <= 100) { sum += i; i++; } console.log(sum); </script> </html>

知识总结

for循环:做已知长度的循环。
创建对象:结构化一个对象。

明天测试内容

1.标题 :title
2.段落:p
3.背景颜色:background-color
4.文本对齐 :text-align:center
6.定义样式定义: var
7.定义资源应用:style
8.定义文档中的节或区域(块级):div
9.定义文档中的行内的小块或区域:span
10.连接标签 :a
11.图像标签 :img
12.定义表格 :table
13.定义表格标题:caption
14.表格的表头 :thead
15.表格的行 :tr
16.定义表格单元:td
17.定义有序列表 :ol
18.无序列表 :ul
19.列表项:li
20.定义列表:dl
1.title 2.p 3.background-color 4.center 5.var 6.style 7.link 8.div 9.span 10.a 11.img 12.table 13.caption 14.th 15.tr 16.td 17.ol 18.ul 19.li 20.dl

最后

以上就是傲娇电灯胆最近收集整理的关于8.2 switch循环、创建对象switch循环、创建对象知识总结的全部内容,更多相关8.2内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(72)

评论列表共有 0 条评论

立即
投稿
返回
顶部