I have a selector that only changes in the last character. I want to grab all the selectors that match the beginning. Here is an example of what I am trying to grab:
"button_selector_[number that changes depending on which button]"
In something like grok, I could use * to denote that the text that would be where that character is doesn't really matter. Does javascript have something similar?
To get all elements with an id starting with button_selector_ do:
var ... = document.querySelectorAll('[id^="button_selector_"]');
And similar for all elements with a class:
var ... = document.querySelectorAll('[class^="button_selector_"]');
Documentation: Substring matching attribute selectors