Home > Article > Web Front-end > js controls whether a button is clickable (can be used) disabled instance
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!