JQuery access dynamically created objects

后端 未结 3 1867
梦如初夏
梦如初夏 2021-01-28 05:41

How can I acceess objects(divs) that were dynamically generated. I mean DIVS that were not present in output when $(document).ready(function() started.

If I

3条回答
  •  滥情空心
    2021-01-28 06:30

    .click() functions that aren't working on spans or divs that are added later, you'll need to use .live()

    $("#clicker2").live("click", function(){
      # do stuff to spans currently existing
      # and those that will exist in the future
    });
    

提交回复
热议问题