I have this code
$(".myclass").on("click", function(e){
alert('Hello');
});
Now its not working on dynamicaly added elements
How can i use like live function
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To use it like live you have to use “delegation”, meaning you attach the handler to a parent element that is present from start, like:
Note what it is saying in the docs:
Also, in case you are worried about performance issues, try to attach the handler as “low” as possible: