How do I get the ID of a list element? Whenever I use this.id it gives me the ID of the parent table. Here’s my code:
$('*').bind('tap', function() {
selectBrick(this.id);
alert(this.id)
});
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.
It seems your selector
'*'is binding the tap event to the table. You could try to use the event object and see if whattargetis – this should be the DOM element that was actually subjected to the event.