Home >Web Front-end >JS Tutorial >A solution to the problem that the first non-hidden element in a form gets focus_Form special effects
There are many elements in form, which are represented by, for example, form.element[x];
The type of an element: The type of an element is represented by element.type
With the above understanding, let us now Let’s solve the first solution for non-hidden elements to gain focus:
First define an object as the method’s applicator:
var f=new Object();
Then: