I am looking to get all elements that end in a number. So, for example, we have <a>with this href.
href="artist.php?id=8932
Now I can get all occurrences of href with:
document.querySelectorAll("[href^='artist.php?id=']")
However, it also gives me results such as
artist.php?id=8932#comments
So, I want so that I can only get hrefs ending with a number in an array. I would not want to first create an array with all the results, and then clear #extras and remove duplicates.
Please note that I will not and will not use jQuery.
source
share