jQuery .on() click event catching dynamic 'data-' attribute in list of buttons to pass value to other function?

前端 未结 5 1366
误落风尘
误落风尘 2021-02-07 04:57

I have a dynamic table list of around 40 rows each with an edit button containing a date field. I also have the following click event script trying to attach to each button via

5条回答
  •  忘掉有多难
    2021-02-07 05:08

    $("body").on("click",".showEdt",function(){
        alert($(this).attr("data-evalz"));
    });
    

    Fiddle here.

提交回复
热议问题