jQuery - cannot bind events to dynamic elements?

后端 未结 6 611
借酒劲吻你
借酒劲吻你 2021-01-13 07:58

I\'ve come to maintain a piece of javascript that downloads some JSON data from the server, builds a new table row (like $(\') and inserts i

6条回答
  •  难免孤独
    2021-01-13 08:01

    Try this:

    var a = $('ASD');
    $("body").html(a);
    a.click(function() {
        alert('a');
        return false;
    });
    

提交回复
热议问题