score:3

Like Pete said, your * is on the wrong side of the equal sign. You also don't need to add . in your selector. Something like this should work for you:

d3.selectAll(`path[class*=${str}]`)


Related Query

More Query from same tag