JavaScript QuerySelectorall ID termina com
console.log(document.querySelectorAll("[id$=foo]"));
Super Sloth
console.log(document.querySelectorAll("[id$=foo]"));