http://www.5icool.org/demo/2012/a00565/?animation=random
在原生js中
想要獲取from表單
使用:document.forms就可以獲取頁面中所有表單,并以數(shù)組的形式展現(xiàn)你出來,再使用document.forms[0].elements就可以遍歷出第一個表單里面的所有子元素
http://www.5icool.org/demo/2012/a00565/?animation=random
在原生js中
想要獲取from表單
使用:document.forms就可以獲取頁面中所有表單,并以數(shù)組的形式展現(xiàn)你出來,再使用document.forms[0].elements就可以遍歷出第一個表單里面的所有子元素