The `*=` operator is perfect for partial matches in an html query selector element. No need for regex unless you’re doing something wild.
Pro tip: If your classes have multiple names (like `btn-primary large`), `[class~="btn-"]` won’t work—it’s for whole words. Stick with `*=` or `^=` for flexibility.
MDN’s docs on attribute selectors are gold for this.
Pro tip: If your classes have multiple names (like `btn-primary large`), `[class~="btn-"]` won’t work—it’s for whole words. Stick with `*=` or `^=` for flexibility.
MDN’s docs on attribute selectors are gold for this.
