I am using elemntFromPoint in order to return onclick some element. I would like to check if the returned element (‘span’ div’ whatever…) is part of a link or if it is a button etc. How should I start? Thanks.
Share
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 check if the element “is part of a link” you’ll want to traverse up the DOM tree until you hit an anchor – if you don’t hit an anchor then the element isn’t in a link. E.g.