Saturday, 12 May 2018

javascript - Click event not working on a div appended dynamically in IE

I am using jquery geocomplete plugin to show address suggestion when user type any address. It appends one div dynamically having class "pac-container". It looks like this :





SDG, Vaishali, Bihar, India

SDGM, Kuber Nagar, Ahmedabad, Gujarat, India

sdgsdf, Isselburg, Germany

Lorong Sdg Kasim B Hamid Malacca Melaka Malaysia




Now my problem is when I click on any of the pac-item I have to stop event bubbling. How can I attach the event handler on dynamically added pac-item for IE.




JS Fiddle : http://jsfiddle.net/EcPdP/2/



It is working fine for all browser except IE. In IE, clicking on pac-item is propagating that click event to body. Please help me to solve this.

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...