使用javascript启用和禁用按钮 [英] enable and disable buttons using javascript

查看:105
本文介绍了使用javascript启用和禁用按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PLZ帮帮我..



如何通过javascript禁用和启用按钮

我的问题是禁用按钮没有启用通过javascript但启用按钮被禁用通过javascript

plz help me out..

how to disable and enable buttons through javascript
my problem is disabled buttons are not getting enabled through javascript but enabled buttons are disabled through javascript

推荐答案

你可以使用这样的javascript找到/搜索任何元素并设置它们的属性。



You can find/search any element using javascript like this and set their attribute.

document.getElementById('button').disabled = true; 



希望这会有所帮助。


Hope this will help.


没有 .enable 属性存在于javascript中以供任何控制。



您必须使用以下代码



there is no .enable property exist in javascript for any control.

you have to use following code

document.getElementById("buttonID").disabled = true


这篇关于使用javascript启用和禁用按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆