以下函數實現了列出頁面中所有html控件類型為text的控件ID
for (var i=0;i<els.length;i++ )
{
if (els[i].type == "text" )
{
//取得控件ID
msgs += els[i].id + ",";
}
}
alert(msgs);
}
|
新聞熱點
疑難解答