CSS / Javascript Show / Hide DIV using a CSS class?

前端 未结 7 1822
陌清茗
陌清茗 2020-12-20 17:14

I\'ve googled around and found many scripts for hiding and showing DIV contents, as a toggle on button click.

But they are work using ID\'s.

I would like to

7条回答
  •  情话喂你
    2020-12-20 18:07

    Is jquery an option? Hopefully so, because this does what you want:

    http://api.jquery.com/toggle/

    $(".class").toggle();
    or
    $(".class").show();  $(".class").hide();
    

提交回复
热议问题