#Javascript #Tutorial #Hindi

Link for Complete JavaScript Tutorial in Hindi for Beginners: https://www.youtube.com/playlist?list=PLjpp5kBQLNTSvHo6Rp4Ky0X8x_MabmKye

Link for Complete HTML and CSS Tutorial in Hindi for Beginners: https://www.youtube.com/playlist?list=PLjpp5kBQLNTSdLVVjU_kea8J8lP24ZseT

In this video i will talk about Traversing elements in JavaScript.

The previous tutorial in this series, How to Access Elements in the DOM, covers how to use the built-in methods of the document object to access HTML elements by ID, class, tag name, and query selectors. We know that the DOM is structured as a tree of nodes with the document node at the root and every other node (including elements, comments, and text nodes) as the various branches.

Often, you will want to move through the DOM without specifying each and every element beforehand. Learning how to navigate up and down the DOM tree and move from branch to branch is essential to understanding how to work with JavaScript and HTML.

With the HTML DOM, you can navigate the node tree using node relationships.

You can use the following node properties to navigate between nodes with JavaScript:

parentElement
firstElementChild
lastElementChild
children
nextElementSibling
previousElementSibling


Please subscribe to watch more videos like this: https://www.youtube.com/channel/UCWCGvAu1NDCldmLasELk62g?sub_confirmation=1



Join this channel to support Tech Gun:
https://www.youtube.com/channel/UCWCGvAu1NDCldmLasELk62g/join