Menu
Hi
I am trying to create an array in a javascript function which will hold some button elements in HTML, so that I can loop them in Javascript.
I can’t get the below code to work:
function buttonclick() {
var array = ()
array[0]=’button_background’;
array[1]=’button_menu’;
array[2]=’button_faq’;
y = array[0]
y.style.backgroundColor=”#cc00cc”;
This obviously isn’t the complete code…no loop etc. But I am just struggling to get the correct syntax for the above.
Any help would be really greatly appreciated.
Many Thanks