Hiding a button in Javascript

前端 未结 9 1322
终归单人心
终归单人心 2020-11-29 05:20

In my latest program, there is a button that displays some input popup boxes when clicked. After these boxes go away, how do I hide the button?

9条回答
  •  眼角桃花
    2020-11-29 05:43

    visibility=hidden
    

    is very useful, but it will still take up space on the page. You can also use

    display=none
    

    because that will not only hide the object, but make it so that it doesn't take up space until it is displayed. (Also keep in mind that display's opposite is "block," not "visible")

提交回复
热议问题