Skip to content Skip to sidebar Skip to footer

A Css Wildcard Selector To Match Dynamic Classnames?

I have a tasks list on my application. Some tasks have subtasks, which are attached to their parents on my html code through a property. These tasks are on a list (both parent and

Solution 1:

It looks like you're trying to match elements whose data-parent attribute corresponds to an existing number based on another element's .parent-element* class. Unfortunately, Selectors does not support this.

Based on your description of the markup I don't think there's much of a way around this other than DOM manipulations. I do wish to add though, that subtasks should ideally be marked up with nested lists. However if you have no control over the source markup, you'll have to find another way.

Post a Comment for "A Css Wildcard Selector To Match Dynamic Classnames?"