Home > Web Front-end > JS Tutorial > Implementation code for setting the disabled attribute of a button using jquery_jquery

Implementation code for setting the disabled attribute of a button using jquery_jquery

WBOY
Release: 2016-05-16 18:15:08
Original
1099 people have browsed it

To set the button to be disabled in the html tag, you can use the following code

In jquery you can use the attr() function to modify the button The disable attribute
$("#test").attr('disabled',false);

jquery controls the disabled attribute of the button

Copy the code The code is as follows:

$('#button').attr('disabled',"true"); Add the disabled attribute
$( '#button').removeAttr("disabled"); Remove disabled attribute
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