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

后端 未结 3 1383
走了就别回头了
走了就别回头了 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:51

    Using plain JavaScript, you could use:

    document.getElementById('div1').style.display = 'none';
    document.getElementById('div2').style.display = 'inline';
    

提交回复
热议问题