(jQuery) Toggle div style “display:none” to “display:inline”

后端 未结 3 1378
走了就别回头了
走了就别回头了 2021-02-13 20:47

I have 2 divs which and I want to be able to toggle between them onClick of a button (currently using .toggle();)

The div that shows on the page is div1. This div has th

3条回答
  •  死守一世寂寞
    2021-02-13 21:37

    I would use .toggleClass() as toggle switches between display: inline; and display: block;

    Create a hidden and inline class and just toggle those.

提交回复
热议问题