1. 程式人生 > >jquery基本Dom操作

jquery基本Dom操作

基本 bsp 獲取 屬性 轉義 jquery 元素 index function

1 html()獲取所有的html內容

2 html(value) 設置html內容,有html自動解析

3 text() 獲取文本內容

4 text(value) 設置文本內容,有html自動轉義

5 val()獲取表單的值

6 val(value) 設置表單的值

7 attr(key) 獲取元素的key屬性的屬性值

8 attr(key,value) 設置元素的key屬性並賦值value

9 attr({key:value,key2:value2,key3:value3})對一個對象設置多個屬性值

10 attr(function(index,value){ })

jquery基本Dom操作