How can I modify the css of an object when iterating through an array of objects? Here's my attempt:
var buttons = $('#nav li');
for(button in buttons){
button.css("opacity","1");
}
But this gives the error:
Uncaught TypeError: Object 0 has no method 'css'
(anonymous function)
k jquery-1.8.0.min.js:2
l.fireWith jquery-1.8.0.min.js:2
p.extend.ready jquery-1.8.0.min.js:2
D
buttonis set to the keys of the object or array, not the values -- JSfor-inis not like PHPforeach.$(buttons[button]).css("opacity","1");works, thank you!