document.getElementsById = function(id){
var el = document.getElementById(id);
if(!el) return el;
var els = document.getElementsByTagName(el.tagName),
i = 0,
res = [];
while(els[i]){
if(els[i].id==id)
res.push(els[i]);
i++;
}
return res;
};
DEMO:
<script>
document.getElementsById=function(e){var a=document.getElementById(e);if(!a)return a;for(var a=document.getElementsByTagName(a.tagName),b=0,c=[];a[b];)a[b].id==e&&c.push(a[b]),b++;return c};
</script>
<div id="a">lol</div><div id="a">lol</div><div id="a">lol</div><div id="a">lol</div><div id="a">lol</div>
<script>
*!*
document.getElementsById('a').forEach(function(a){a.style.border="1px red solid"});
*/!*
</script>