Home > Web Front-end > JS Tutorial > How to set the button gray and unavailable in jquery

How to set the button gray and unavailable in jquery

coldplay.xixi
Release: 2021-01-07 17:50:39
Original
2978 people have browsed it

How to set the button gray and unavailable in jquery: 1. Set the dynamic binding of parameters in the html code, the code is [onclick="getpass(${audit.lid})"]; 2. jquery code , the code is [$("#" id).css({'background-].

How to set the button gray and unavailable in jquery

The operating environment of this tutorial: windows7 system, jquery3.2.1 version , Dell G3 computer.

jquery setting button gray unavailable method:

html code

My id and Method parameters are all dynamically bound

<button id="${audit.lid}" onclick="getpass(${audit.lid})" style="background-color:#8ac007;color:white">通过</button>
Copy after login

jquery code

function getpass(id){
$("#"+id).css({&#39;background-color&#39; : &#39;gray&#39;});
$("#"+id).attr("disabled", true); 
}
Copy after login

Related learning recommendations: javascript video tutorial

The above is the detailed content of How to set the button gray and unavailable 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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template