Velo by Wix: Query selector for child elements

--

Get the child elements inside a parent node. In this post, we take a look deeper at $w() selector and try to filter children elements by the specific parent node

Read this article on my Blog

Let’s suppose we have a few containers with checkboxes in each of them. We don’t know how many checkboxes will be in each container at the final design.

Each container has a “select all” named checkbox that allows us to check on/off all checkboxes into a current target container.

We want to provide a good abstract solution for avoiding hard coding of elements’ ID. And ensure scaling for any count of the elements in the future.

In general, we need to find a way to query select all child elements into a specific parent node. There are exist similar selectors in DOM and CSS.

More: Blog Post

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response