Jquery method to make the id element uneditable: 1. Get the specified element through the id attribute value, the syntax "$("#id value")" will return a jquery object containing the specified element; 2. Use Attr() sets the disabled attribute to the obtained element object to make the element uneditable. The syntax is "id element object.attr("disabled", "disabled");".
The operating environment of this tutorial: windows7 system, jquery3.6.0 version, Dell G3 computer.
jquery method to make the id element uneditable
1. Get the specified element through the id attribute value
$("#id值")
will return a jquery object containing the specified element
2. Make the obtained element object uneditable
Just use the attr() method to add the element Set the disabled attribute to make the element uneditable.
[Recommended learning:jQuery video tutorial,web front-end video】
The above is the detailed content of How to make the id element uneditable in jquery. For more information, please follow other related articles on the PHP Chinese website!