adding jQuery click events to dynamically added content

后端 未结 4 610
礼貌的吻别
礼貌的吻别 2020-11-28 13:33

I have a table with multiple rows and columns populated by php and mySQL. For some of the td\'s I\'m adding jQuery click-events in the document.ready function to let the use

4条回答
  •  遥遥无期
    2020-11-28 14:06

    Use the live event handler. It doesn't handle all events, but it does handle the click event. The handler will be bound to all current and future elements that match the selector.

    $('tr.clickable').live( 'click', function() {
       ...
    });
    

提交回复
热议问题