Subject: | does not select elements by name |
Does not select elements by name, but in error messages 'ERROR: Cant find HTML element with id or name:'
Why you not added another condition
if(!element){
var element = document.getElemenstByName(id);
}