我的问题是: (仅作为例子,不能使整体感):JavaScript函数参数声明
// make a function and pass part of the statement as argument
function ExampleFunction(argument) {
document.getElementById('TestID')[0].style.argument = '#f00';
}
// then later onload
ExampleFunction(background);
我发现它不以这种方式工作,但我不能找到怎么会是对的。 如果有人能改正这个例子,让我在路上,我会非常高兴和感激。
可能重复:http://stackoverflow.com/questions/16413167/how-to-access-a-dynamic-property- objectname-variable – 2013-05-13 00:10:16