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不换行

原文地址:https://www.cnblogs.com/kongxc/p/7728562.html