Menu
sorry i have a stupid question
i have made some functions to control the class of some divs, and i m using a lot of document.getElementById(‘divname’).style.
my functions work pretty well, but i found it quite clumsy to write many document.getElementById(‘divname’) so i tried to define variable like:
var a = document.getElementById(‘divname’);
and used it as:
a.style.display=’none’;
OR
a.innerHTML=’bla bla bla’;
but somehow they do not work ?
i wonder what the problem is, whether there is any way to make my code neat and simple.
Thank you for your help in advance.