How to make the id element uneditable in jquery

青灯夜游
Release: 2022-06-10 16:31:29
Original
1674 people have browsed it

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");".

How to make the id element uneditable in jquery

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值")
Copy after login

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.

      




Copy after login

How to make the id element uneditable in jquery

[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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!