Home  >  Article  >  Web Front-end  >  js controls whether a button is clickable (can be used) disabled instance

js controls whether a button is clickable (can be used) disabled instance

高洛峰
高洛峰Original
2017-02-17 17:26:241903browse

The following editor will bring you an example of using js to control whether a button is clickable (available) or disabled. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look.

The example is as follows:

/***
 * 设置按钮是否可点击
 */
function abledDownloadBtn(flag) {
	var $exportChartBtn = $("#exportChartBtn");
	flag ? $exportChartBtn.removeAttr("disabled") : $exportChartBtn.attr("disabled", "disabled");
}

The above js controls whether a button can be clicked (can be used) The examples of disabled are all the content shared by the editor. I hope it can give you a reference, and I also hope that everyone will support the PHP Chinese website.

For more examples of js controlling whether a button can be clicked (available) or disabled, please pay attention to the PHP Chinese website for related articles!

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