js实现按钮可用不可以变灰

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

按钮可用方法:document.getElementById(“id”).removeAttribute(“disabled”);

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

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

猜你喜欢

转载自blog.csdn.net/weixin_43611712/article/details/92434352