如果通过 javascript 禁用按钮,如何将其显示为无?

问题描述 投票:0回答:1

我正在使用 VScode,它会向您显示可能的函数/变量。但是,当我编写 (button.style.display = "none") & (button.style.display = "block") 时,VScode 似乎没有在括号中给出任何可能性。这意味着我的实时服务器上没有任何变化的迹象。请帮忙!

             <form class="next_page" type="submit" id="nextButton">
               <button disabled="disabled" onload="remove()"
                          <span class="material-symbols-outlined" font- 
                size="32px">arrow_circle_right</span>

                <script remove_hover>

               if (document.getElementById('nextButton').setAttribute('disabled', 'disabled')) {
                            button.style.display = "none"
                        } else {
                            button.style.display = "block"
                        }
                    </script>
                </button>
               </form>
javascript css button
1个回答
0
投票
if (document.getElementById('nextButton').disabled)
button.style.display = "none"
else
 button.style.display = "block"

这是你想要的吗?

© www.soinside.com 2019 - 2024. All rights reserved.