Files
notes_estom/JavaScript/jQuery/1简介.md
2020-07-21 09:13:01 +08:00

68 lines
850 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.
## 1 功能
> jquery是js的一个框架。目的是对js的编程方式进行封装提供了新的编程方法。简化过程。
基本内容:
* HTML 元素选取
* HTML 元素操作
* CSS 操作
事件和动画处理
* HTML事件处理
* JavaScript 特效动画
* HTML DOM 遍历和修改
* AJAX
* Utilities
## 2 引用
### 使用本地jquery
```
<head>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
</head>
```
### 使用CDN
```
<head>
<script src="https://lib.sinaapp.com/js/jquery/2.0.2/jquery-2.0.2.min.js">
</script>
</head>
```
## 3 CSS选择器
### 元素选择器
```
$("p")
```
### #id选择器
```
$("#test")
```
### .class 选择器
```
$(".test")
```
### 属性选择器
```
$("[href]")
```
### 特殊选择器
```
$("*") 选取所有元素
$(this) 选取当前 HTML 元素
```