Good time of day!

If the item is through append, how to get its events and this to it?

bind / change / on - do not work.

Works out only:

$(document).on({ change: function() { } }, '.napolnenie-el-material'); 

but with this, I can't get the fields of the added item = undefined.

    2 answers 2

    You must use the jquery live function. It sets an event handler, including those elements that satisfy the specified selector, which will be added after the declaration.

     $("#id").live(function() { alert($(this).val()); }); 
    • The live() method is deprecated since version 1.7 and was removed in version 1.9. Version 3.1 is now relevant. - neluzhin

    You need something like this:

     $(document).on('change', '.napolnenie-el-material', function() { /* ... */ }); 

    The second argument in the on() method accepts a selector on which events will be posted even if elements that fall under the selector were added dynamically via append() , prepend() , html() and in any other way.