Adding a class to dynamic content

Adding a class to dynamic content

Hello,

I'm trying to add classes to a dynamically generated bootstrap datepicker.

on a static page this code works
  1.  $(window).load(function() {

            $( ".day" ).each(function()
  2.         {
                    $_inner = $(this).text();
                    $(this).addClass( "day_number" +   $_inner + ""); 
            });
    });


but on the dynamically generated not.

I don't know how to work width on() in that case.

any help would be appreciated.