Add Class to Object on Page Load

后端 未结 2 1612
暗喜
暗喜 2020-12-16 04:49

Basically I want to make this:

  • About
  • Into this when the page loads:

    &l         
    
    
            
    2条回答
    •  鱼传尺愫
      2020-12-16 05:08

      I would recommend using jQuery with this function:

      $(document).ready(function(){
       $('#about').addClass('expand');
      });
      

      This will add the expand class to an element with id of about when the dom is ready on page load.

    提交回复
    热议问题