// Gather needed DOM elements
var dom = getElementsByIds('myContainer','mySlider','myBtn','myBtn.a','myBtn-1');
// Manipulate some gathered objects
dom.myContainer.style.backgroundColor = "red";
dom.mySlider.value = 20;
dom.myBtn.addEventListener("click", function(){ alert("button pushed"); });
// More complex ids need special care...
dom['myBtn.a'].addEventListener("click", function(){ alert("button pushed"); });
dom['myBtn-1'].addEventListener("click", function(){ alert("button pushed"); });
Found this one by searching "getElementsByIds". Probably should have searched for a solution more carefully prior to writing one. Well, at least I learned to improve my script by cloning the array properly, as done in the following suggestion.