Home >Web Front-end >JS Tutorial >jquery disable button (enable, disable button)

jquery disable button (enable, disable button)

PHPz
PHPzforward
2016-05-16 19:20:502476browse

This article mainly talks about buttons in jquery, as well as the activation and disabling of buttons. Interested friends, please continue reading

Disable button:

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

Enable button:

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

Note:

1、$("#id").attr("disabled","false");不起作用
2、disabled只能禁用button,对超链接不起作用

For more related tutorials visit JavaScript Video tutorial

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete