document.getElementById(“test”).style.display=“hidden” not working

后端 未结 11 969
没有蜡笔的小新
没有蜡笔的小新 2021-02-02 14:10

I want to hide my form when I click on the submit button. My code is as follows:



        
11条回答
  •  清歌不尽
    2021-02-02 14:57

    Maybe you can add a class like 'hide'.

    Follow the example here : https://developer.mozilla.org/fr/docs/Web/API/Element/classList.

    document.getElementById("test").classList.add("anotherclass");

提交回复
热议问题