This article mainly introduces the use of JavaScript implementation to disable all text boxes on a Web page, Drop-down menu, multiline text fields. Need friends can come to the reference, I hope to help you.
The principle is to loop through the controls on the Web page, and then set the Disabled property to true. Code as follows: code is as follows: <script type= "Text/javascript" > var nodelist = Document.getelementsbytagnam E ("input"); for (var i = 0; i < nodelist.length i++) { nodelist[i].disabled = true; &nbs P } nodelist = document.getElementsByTagName ("select"); for (var i = 0; i < nodelist.length i++) { nodelist[i].disabled = true; &nbs P } nodelist = document.getElementsByTagName ("textarea"); for (var i = 0; i < nodelist.length i++) { nodelist[i].disabled = true; &nbs P } </script> The following are the types of controls: via Document.getelementsbyname ("controlname") [0]. Type.tolocalelowercase () can be obtained. Depending on the control, there are several types: "Text" "TextArea" "Select-one" "Select-multiple" "Radio" "checkbox"