How can I hide/show a div when a button is clicked?

前端 未结 8 1959
陌清茗
陌清茗 2020-12-04 22:02

I have a div that contains a register wizard, and I need hide/show this div when a button is clicked. How can I do this?

Below I show you t

8条回答
  •  醉话见心
    2020-12-04 22:15

    This can't be done with just HTML/CSS. You need to use javascript here. In jQuery it would be:

    $('#button').click(function(e){
        e.preventDefault(); //to prevent standard click event
        $('#wizard').toggle();
    });
    

提交回复
热议问题