> 文章列表 > js学习记录01

js学习记录01

js学习记录01

js有几部分组成
两部分
ecmascript
webapi
dom:dom操作指的是发送弹幕操作
bom :发送文件操作
了解js:https://developer.mozilla.org/zh-CN/

js的书写位置
内部
外部
行内
同时写的时候写在
js得写在body的下方,说明html都写完了,只有html写完了js才能找到操作
外部js

<body><script src="./js/my.js">//中间不要写内容</script>
</body>

js注释
ctrl + /
多行是shift + alt + a

code代码过程
:按 !+ tab键 自动生成快捷html
:「shift + Alt + ↓」复制一行

js的语法
输出的语法
document.write()
console.log()
alert()

<script>document.write('我是div标签')document.write('<h1>我是标题</h1>')console.log("看看对不对")prompt('请输入你的年龄')//输入</script>

js的执行顺序
alert和prompt先执行

变量