js中实现button按钮变灰不可用,可用的方法


按钮变灰不可用方法:document.getElementById("crop").setAttribute("disabled", true);

按钮可用方法:document.getElementById("crop").removeAttribute("disabled");

按钮隐藏方法:$("#crop").hide();或document.getElementById(‘crop’).style.display="none";

按钮显示方法:$("#crop").show();或document.getElementById(‘crop’).style.display="inline-block";//block是块级显示,自动换行,inline-block不换行


猜你喜欢

转载自blog.csdn.net/chp891202/article/details/71172232