Jquery on click event is not working on dynamically added Custom tags

84 views Asked by At

Jquery on click event is not working on dynamically added Custom tags

My code is

  $("[addtoShip='yes']").on('click', function() {
         alert('Ship added')
  });

Href for <a href="#" addtoShip='yes' myVal="10235">add more to Ship</a>

I am trying using .on But still it's not working

1

There are 1 answers

1
Tushar On
$(document/CommonParentSelector).on('click', "[addtoShip='yes']", function () {
    alert('Ship added')
});