Jquery append() limit

前端 未结 2 1250
醉话见心
醉话见心 2021-01-17 09:13

Hi all I have this scripts and I want to append happen only six times

$(\".upload_add\").click(function(){
    $(\"#film_upload_side\")
    .ap         


        
2条回答
  •  被撕碎了的回忆
    2021-01-17 09:49

    Set a counter:

    var counter = 0;
    $(".upload_add").click(function(){
        counter++;
        if(counter<7)
        $("#film_upload_side").append('
    Shoose file to upload
    '); });

提交回复
热议问题