$("#dataTable tbody").on("click", "tr", function(event){
alert($(this).text());
});
is this syntax is for tr’s which are already on the Page ?
and if not , What is the syntax for future tr’s elements ?
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.
For future elements inside
#dataTable tbody, your code should work. To delegate the click all the way up to the document, allowing the same handler for future<tr>anywhere on the page, try: