functiongetElementByCName(cName){var result =[];var lis = document.getElementsByTagName('*');for(var index =0; index < lis.length; index++){if(lis[index].className == cName){
result.push(lis[index]);}}return result;}var result =getElementByCName('lis');for(var i =0; i < result.length; i++){
result[i].style.background ="green";}
console.log(result);