javascript-使用

 

##基础

作用:
html静态页面--->动态页面,与用户交互

2用法:
与style样式一样
内联 元素属性绑定
<div style="" onclick="alert('hello world')">
鼠标单击
</div>
内嵌
<script>
alert('你好')
console.log('哈哈哈')
document.write('haha')
</script>

外联
<script src="./js/index.js"></script>
js文件地址

posted @ 2019-11-19 13:44  chenlulu1122  阅读(84)  评论(0)    收藏  举报