Initialize script

前端 未结 4 1750
灰色年华
灰色年华 2021-01-25 10:01

I need to learn how to initialize scripts. I have google it but dont dont really understand it.

Right now I have a toggle-script that is in a div, that entire div gets l

4条回答
  •  北海茫月
    2021-01-25 10:27

    simple and best

    $(function(){
        //your code here...
        $(".class").click(function () {
           $(this).toggleClass("add_class");
        });
    });
    

提交回复
热议问题