Jquery append() limit

前端 未结 2 1254
醉话见心
醉话见心 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:53

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

    check flag when it becomes 6, then stop appending.

提交回复
热议问题