How do I target an HTML query selector element that contains a partial class? or What's the best way

22 Replies, 2159 Views

`[class*="btn-"]` is the way! It’s the most efficient method for partial class matching in an html query selector element.

If you’re dealing with messy markup, test it thoroughly—sometimes classes get mangled by frameworks.

Regex is overcomplicating it unless you’ve got a *very* specific need.

Messages In This Thread



Users browsing this thread: 1 Guest(s)