Hide div by default and show it on click with bootstrap

后端 未结 4 865
深忆病人
深忆病人 2020-12-22 19:10

I want to show and hide a div, but I want it to be hidden by default and to be able to show and hide it on click. Here is the code that I have made :



        
4条回答
  •  醉话见心
    2020-12-22 19:21

    Just add water style="display:none"; to the

    Fiddles I say: http://jsfiddle.net/krY56/13/

    jQuery:

    function toggler(divId) {
        $("#" + divId).toggle();
    }
    

    Preferred to have a CSS Class .hidden

    .hidden {
         display:none;
    }
    

提交回复
热议问题