webveuje/javascript/2.在html中使用javascript.md
2020-12-16 15:58:10 +08:00

31 lines
360 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 在html中使用javascript
## 引入 <script>
> 使用script标签引入
### script标签属性
- src
- async
- charset
- defer
- language(不推荐)
- type不推荐
## 如何在html中使用
```html
<script>
// javvscript 代码
</script>
```
```html
<script src="url"></script> <!-- 引入外部文本 -->
```
## 标签位置
- head
- body