I want to read the HTML tags with Javascript without using id/class. I know about the functionality of getElementById. But I want to know how to read HTML tags without using id or class in Javascript and not by Jquery.
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.
The entire DOM API is there for you.
(element).getElementsByTagNamegets elements by tag name.(element).getElementsByClassNamegets elements by class name.(element).querySelector[All]gets an element/elements based on a CSS selector.(element).childrengets an element’s child elements.(element).childNodesgets an element’s child nodes.The list goes on and on.