Home  >  Article  >  Web Front-end  >  Detailed explanation of Javascript traversal of page text control_javascript skills

Detailed explanation of Javascript traversal of page text control_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:05:101124browse

The following function implements the control ID of all HTML control types in the page that are listed as text

Copy code The code is as follows:

function Texts()
{
//var els= document.getElementsByTagName("*"); //els gets all controls on the page
var els= document.getElementsByTag Name( "INPUT"); //The above can also be used, which can reduce loops
var msgs="";

                                                                                         //Get the control ID
                                                                                   }


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn