首页 > 技术文章 > js控制button

kongxc 2017-10-25 14:13 原文

按钮变灰不可用方法: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不换行

推荐阅读