I am new to javascript and I want to get the elements by the name with help of loop but can not get the elements. Kindly help so that i can reduce the lot of code by using loop.
Below are the lines of code
function (e){
for(var i=1;i<5;i++){
var name = "qption0"+i;
var clicableObject = document.getElementById(name);
clicableObject.backgroundColor = "#00FF00";
}
}
Above code is in JAVASCRIPT
getElementById