How to display one div and hide all others

前端 未结 7 1183
温柔的废话
温柔的废话 2020-12-11 11:40

I want to display a div on each button click and also want to hide the other all divs how I can do it.

HTML

7条回答
  •  清歌不尽
    2020-12-11 12:18

    Just start by hiding all other div's, then showing the one you want to be shown.

    $​('#w').live('click', function(){
        $('div').hide();
        $('#a').show();
    });
    

提交回复
热议问题