楼主:
MadCaro (實è¸!!ä¸æŽ¥å¯µç‰©æºé€šè¬è¬)
2021-11-26 12:55:1908:30起床,
做了护膝三动作,
09:00开始学JavaScript,
开始应用番茄时钟法,这样我才会记得要起来动一动,
09:25开始写第三周的练习作业,
1. 8/9 (一) - JSON 格式判断
https://codepen.io/Sunny0509/pen/BadXpYa?editors=0010
2. 8/10 (二) - 捞出想要的 JSON 资料
https://codepen.io/Sunny0509/pen/KKvOaBN?editors=1010
3. 8/11 (三) - 阵列物件搭配 if 流程判断练习
https://codepen.io/Sunny0509/pen/XWavpGE?editors=0010
4. 8/12 (四) - 函式写法教学、函式观念加强
https://codepen.io/Sunny0509/pen/QWMedep
5. 8/13 (五) - 函式传参数、return 练习
https://codepen.io/Sunny0509/pen/PoKMpZN?editors=0010
完成第三周的作业了,我棒棒
接下来继续上课
let el = document.querySecletor("h1");
querySecletor:选取网页上的元素
querySecletor("h1"):选取网页上h1的元素
括湖内可以改成其他类别选择器
el.textContent = "hello world!!";
可以动态的把el的文字内容修改成"hello world!!"
textContent 写入文字资料作业:
https://codepen.io/Sunny0509/pen/eYEqvVP
el.innerHTML=`MadCaro好会赚钱`;
在变量el上新增html的内容
会清空并覆蓋掉原本的html的内容
再重新做写入
要新增HTML标签就使用innerHTML
作业: https://codepen.io/Sunny0509/pen/qBXerQB
innerHTML加变量作业:
https://codepen.io/Sunny0509/pen/NWvQpoy
如果是单纯改文字用textContent
整个元素(包括文字)都要改用innerHTML
养成好习惯先确认有抓到在下一步
setAttribute作业连结:
https://codepen.io/Sunny0509/pen/QWMevWB
document.querySelector只会抓第一个节点
document.querySelectorAll会回传阵列
qeurySelectorAll作业:
https://codepen.io/Sunny0509/pen/oNeKWbz
.innerHTML、.textContent、.getAttribute 取值方法
https://codepen.io/Sunny0509/pen/abyeWWd?editors=1111
表单取值:
https://codepen.io/Sunny0509/pen/bGrXWom
进度推进到57%
接下来进入event章节,但是我要出门一趟了!!