Home >Web Front-end >JS Tutorial >Use javascript to disable all text boxes, drop-down menus, and multi-line text fields on the web page_javascript skills
The principle is to loop through the controls on the web page, and then set the disabled attribute to true.
The code is as follows:
Can be obtained through document.getElementsByName("controlName")[0].type.toLocaleLowerCase().
There are the following types according to different controls:
"text"
"textarea"
"select-one"
"select-multiple"
"radio"
"checkbox"