Some hidden attributes will be placed on some form submission pages. The following describes how to control valueless attributes such as hidden and disable in jQuery, if you are interested, do not miss it. Generally, some hidden attributes will be placed when some form submission pages are implemented.
For example, when modifying a record, the id of the record is embedded in the editing window.
On the display interface, you sometimes need to set the input or select box to disable to avoid modification.
Hidden in the following code does not work normally in IE
The Code is as follows:
Additional value should be added to standard writing.
The Code is as follows:
Sometimes we need to edit the above two items on the current page. What should we do?
We can use
The Code is as follows:
$ ("# Role_name"). removeAttr ("disabled ");
$ ("# Role_id"). removeAttr ("hidden ");
Or
The Code is as follows:
$ ("# Role_name"). prop ("disabled", false );
$ ("# Role_id"). prop ("hidden", false );
$ ("# Role_name"). prop () returns a boolean value to check whether the property prop () method is enabled and whether the option is selected in the checked option.
Generally, prop () takes effect only when the write attribute name is used and boolean is used to control the attribute status.