This article is mainly on the JavaScript traversal page text control is introduced, the need for friends can come to the reference, I hope to be helpful to everyone
The following function implements the control ID code that lists all HTML control type text in the page as follows: function texts () &NBS P { //var els= document.getelementsbytagname ("*"); //els Get page All controls var els= document.getelementsbytagname ("INPUT"); The above can also be reduced to cycle var msgs= ""; &NBS P for (var i=0;i<els.length;i++) { &nbs P if (els[i].type = "text") &NBS P { //get control ID&NB Sp &NBSP;MSGS = els[i].id + ","; & nbsp &NBSP; } } &NB Sp alert (msgs); &NBSP}