Yo! `[class*="btn-"]` is totally valid, but watch out—it’ll also match stuff like `disabled-btn-primary` if that’s not what you want.
If you need *only* classes that *begin* with "btn-", use `[class^="btn-"]` instead.
For regex fans, you *could* do `document.querySelectorAll('[class]').filter(el => el.className.match(/btn-/))`, but that’s slower. CSS selectors FTW!
If you need *only* classes that *begin* with "btn-", use `[class^="btn-"]` instead.
For regex fans, you *could* do `document.querySelectorAll('[class]').filter(el => el.className.match(/btn-/))`, but that’s slower. CSS selectors FTW!
