开发者社区 问答 正文

js怎么设置按钮隐藏

js怎么设置按钮隐藏

展开
收起
云计算小粉 2018-05-10 19:59:58 1613 分享 版权
1 条回答
写回答
取消 提交回答
  • function DisplayAndHiddenBtn(btnId, type) { var currentBtn = document.getElementById(btnId); if (type == "d") { currentBtn.style.display = "block"; //style中的display属性 } else if (type == "h") { currentBtn.style.display = "none"; } }
    2019-07-17 22:10:39
    赞同 展开评论