當前位置:才華齋>設計>網頁設計>

jQuery遍歷Form示例程式碼

網頁設計 閱讀(1.63W)

jQuery 遍歷 Form,程式碼如下

jQuery遍歷Form示例程式碼

複製程式碼 程式碼如下:

// 取得 id 為form1 的' form 的所有輸入變數

values = $("#form1")alizeArray();

var values, index;

for (index = 0; index < th; ++index)

{

if (values[index] == "textfield2")

{

// 改變 form 中指定 input 的值

values[index]e = "hello";

}

}