####1.文檔就緒
```
window.onload=function(){
//必須等所有內容加載完(包括img)才能執行;
};
$(document).ready(function(){
//DOM加載完就觸發;
})
$(function(){
//簡寫;
});
(function($){
//加載自執行;
})(jQuery);
```
####2.jQ選擇器
#####1.基本選擇器
```
$("#logo,.item,p") //多選
$("p.intro") //.intro的<p>元素
$("p:first") //第一個p元素
$("ul li:first") //第一個ul的第一個li
$("ul li:first-child") //每個ul的第一個li
$("[href]") //帶有href屬性的元素
$("a[target='_blank']") //所有target屬性值等于"_blank"的a元素
$("a[target!='_blank']")
$(":button") //所有type="button"的input元素和button元素
$("tr:even") //偶數位置tr
$("tr:odd") //奇數位置tr
```
######2.表單選擇器
```
```