選擇器
* 是什么?
* 有特定語法規則(css選擇器)的字串
* 用來查找某個/些DOM元素: $(selector)
* 分類
* 基本
* #id
* tagName/*
* .class
* selector1,selector2,selector3: 并集
* selector1selector2selector3: 交集
* 層次
* 找子孫后代, 兄弟元素
* selector1>selector2: 子元素
* selector1 selector2: 后代元素
* 過濾
* 在原有匹配元素中篩選出其中一些
* :first
* :last
* :eq(index)
* :lt
* :gt
* :odd
* :even
* :not(selector)
* :hidden
* :visible
* [attrName]
* [attrName=value]
* 表單
* :input
* :text
* :checkbox
* :radio
* :checked: 選中的
4. 屬性/文本
* 操作標簽的屬性, 標簽體文本
* attr(name) / attr(name, value): 讀寫非布林值的標簽屬性
* prop(name) / prop(name, value): 讀寫布林值的標簽屬性
* removeAttr(name)/removeProp(name): 洗掉屬性
* addClass(classValue): 添加class
* removeClass(classValue): 移除指定class
* val() / val(value): 讀寫標簽的value
* html() / html(htmlString): 讀寫標簽體文本
* index(): 得到當前dom元素在所有兄弟中的下標
3. 選擇器
* 是什么?
* 有特定語法規則(css選擇器)的字串
* 用來查找某個/些DOM元素: $(selector)
* 分類
* 基本
* #id
* tagName/*
* .class
* selector1,selector2,selector3: 并集
* selector1selector2selector3: 交集
* 層次
* 找子孫后代, 兄弟元素
* selector1>selector2: 子元素
* selector1 selector2: 后代元素
* 過濾
* 在原有匹配元素中篩選出其中一些
* :first
* :last
* :eq(index)
* :lt
* :gt
* :odd
* :even
* :not(selector)
* :hidden
* :visible
* [attrName]
* [attrName=value]
* 表單
* :input
* :text
* :checkbox
* :radio
* :checked: 選中的
4. 屬性/文本
* 操作標簽的屬性, 標簽體文本
* attr(name) / attr(name, value): 讀寫非布林值的標簽屬性
* prop(name) / prop(name, value): 讀寫布林值的標簽屬性
* removeAttr(name)/removeProp(name): 洗掉屬性
* addClass(classValue): 添加class
* removeClass(classValue): 移除指定class
* val() / val(value): 讀寫標簽的value
* html() / html(htmlString): 讀寫標簽體文本
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/199373.html
標籤:jQuery
上一篇:overflow的多個作用
