There are many ways to set attributes in batches. This article describes how to set the readonly and disabled attributes in batches using jquery.
The Jquery api provides a method to apply the disabled and readonly attributes to elements, which is recorded here. 1. the readonly code is as follows: $ ('input '). attr ("readonly", "readonly") // set the input element to readonly $ ('input '). removeAttr ("readonly"); // remove the readonly attribute of the input element if ($ ('input '). attr ("readonly") = true) // determine whether the readonly attribute has been set for the input element. There are two methods to set the readonly attribute for the element and cancel the readonly attribute: $ ('input '). attr ("readonly", true) // set the input element to readonly $ ('input '). attr ("readonly", false) // remove the readonly attribute of the input element $ ('input '). attr ("readonly", "readonly") // set the input element to readonly $ ('input '). attr ("readonly", "") // remove the readonly attribute of the input element 2. the disabled code is as follows: $ ('input '). attr ("disabled", "disabled") // set the input element to disabled $ ('input '). removeAttr ("disabled"); // remove the disabled attribute of the input element if ($ ('input '). attr ("disabled") = true) // you can determine whether the disabled attribute has been set for the input element. There are two methods to set the disabled attribute for the element and cancel the disabled attribute: the Code is as follows: $ ('input '). attr ("disabled", true) // set the input element to disabled $ ('input '). attr ("disabled", false) // The code for removing the disabled attribute of the input element is as follows: $ ('input '). attr ("disabled", "disabled") // set the input element to disabled $ ('input '). attr ("disabled", "") // remove the disabled attribute of the input element