Generally we place some hidden attributes when implementing some form submission page
For example, when you modify a record, the ID of the record is embedded in the edit window
In the presentation interface, it is sometimes necessary to set the input or select Marquee to disable to avoid user modification
The hidden in the following code does not function properly in IE
Copy Code code as follows:
<input name = "Role_name" id = "Role_name" value= "Roy" disabled>
<input name = "role_id" id = "role_id" Hidden value= "3312" >
Standard wording should have added value
Copy Code code as follows:
<input name = "Role_name" id = "Role_name" value= "Roy" disabled = "Disabled" >
<input name = "role_id" id = "role_id" hidden = "hidden" value= "3312" >
Sometimes we need to edit the current page as above two, then what should be done?
We can use
Copy Code code as follows:
$ ("#role_name"). Removeattr ("Disabled");
$ ("#role_id"). Removeattr ("hidden");
Or
Copy Code code as follows:
$ ("#role_name"). Prop ("disabled", false);
$ ("#role_id"). Prop ("hidden", false);
Where $ ("#role_name"). Prop () returns a Boolean value that confirms whether this property has been turned on prop () method can also be used in checked options to control whether the option is selected
In general, prop () can be effective for writing property names and can be used for properties that use a Boolean control attribute state