JQuery click event is not working on dynamically created li
In my website https://www.giftstoindia24x7.com , on a button click event (in jQuery) I am populating a dynamically created html list. It is working fine but when I am using jQuery click event on dynamically created ul Li , it is not working.
The code is as follows:
$(document).ready(function() { $('ul.cls-ul li').click(function(e) { alert(this); }); })
Is there any better solution?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jin NecesarioRank #173 · 13.9K reputationPosted May 23, 2020, 1:28 AM EDT
Salman BegRank #284 · 8.8K reputationPosted May 18, 2020, 12:37 AM EDT