Docs Installation Playground Explore AST

Set on System Basis

Traversing Elements in BroCode

Traversing elements helps you move around your document like a pro! You can easily access the parent of an element or its children. Let’s break it down in BroCode style.


Quick Reference 🛠️

Get Parent Element

Use this to grab the parent of an element. Great for climbing up the DOM tree!

BROCODE
bro <element> ka parent <variable> me rakhde;

This helps you find the parent element in the DOM, making it easier to perform actions like removing or modifying the parent.

Get Child Elements

Get all the child elements of an element and store them in a variable.

BROCODE
bro <element> ka children <variable> me rakhde;

This allows you to grab all children elements of a selected element, making it easy to work with nested elements.

Examples 💡

1Selecting Parent

Here’s how to get the parent of an element for any action like manipulation.

BROCODE
bro myElement ka parent parentElement me rakhde;
Gets the parent of the element and stores it for easy access.

2Selecting Children

Use this to select all children of an element and work with them.

BROCODE
bro myList ka children listItems me rakhde;
Selects all child elements of the parent element for easy manipulation.

BroCode © 2024. All rights reserved.