0

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

Mangesh Sathe
  • 1,684
  • 3
  • 16
  • 36

1 Answers1

1
$(document/CommonParentSelector).on('click', "[addtoShip='yes']", function () {
    alert('Ship added')
});
Tushar
  • 78,625
  • 15
  • 134
  • 154