we ship worksallmenu.html in container

  .co34 jQuery(function ($) { $('.m4').on('click', call); function call() { var msg = $('.co34').serialize(); $.ajax({ type: 'POST', url: 'ajax/worksallmenu.html', data: msg, success: function(data) { $('.co34').html(data); }, error: function(xhr, str){ alert('ошибка: ' + xhr.responseCode); } }); } }); 

How to assign an event to the item that is loaded?

(writing a script in a loadable html is not an option)

    1 answer 1

     $(".co34").on("click", "selector for dynamically loaded element", function(e) { ... }); 
    • one
      thanks It works. lured old .click () - abooks abooks