Execute .on() function automatically after page load

后端 未结 2 1162
故里飘歌
故里飘歌 2021-01-29 09:55

I use $(\"#container\").on(\"click\", contentEffects); to make some jquery code work again after ajax call. However, I hope the .on() function can be e

2条回答
  •  春和景丽
    2021-01-29 10:37

    use this code to execute .on function after page load.

    $(document).ready(function() {
             $("#container").on("click", function() {
             //Your Code
             });
    });
    

提交回复
热议问题