js 代码片段如下:
function currency_change(value) {
// change all currencies on the page
$$('label.currency').each(function() {
this.innerHTML = value;
});
alert(value);
}
我知道 value
是正确的,我知道我正在遍历每个 label.currency 类,但我似乎无法更改这些元素的 innerHTML
值.
我疯狂地用谷歌搜索,但我不知道该怎么做。我怀疑 this
有问题。
最佳答案
试试这个:
$$('label.currency').each(function(element) {
element.update(value);
});
关于javascript - 原型(prototype)中的 this.innerHTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7290784/