Home  >  Article  >  Web Front-end  >  What to do if the jquery control does not edit

What to do if the jquery control does not edit

藏色散人
藏色散人Original
2021-11-18 10:29:171727browse

Solution to the non-editable jquery control: 1. Turn on disabled through "$("#id").attr("disabled","disabled"); 2. Turn on disabled through "$("#id ").removeAttr("disabled");"Turn off disabled.

What to do if the jquery control does not edit

The operating environment of this article: windows7 system, jquery3.2.1 version, DELL G3 computer

What should I do if the jquery control does not edit?

jQuery controls the input that cannot be edited

1. Turn on disabled, but the input cannot be edited

$("#id").attr("disabled","disabled");

2. Turn off disabled

$("#id").removeAttr("disabled");

Ordinary js It is written like this, document.getElementById("id").disabled = false;

Wrong writing:

$("#id").attr("disabled","false");

Recommended learning: "jquery video Tutorial

The above is the detailed content of What to do if the jquery control does not edit. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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