Internet explorer Mootools新元素&x27;类别';IE 7和8中的bug

Internet explorer Mootools新元素&x27;类别';IE 7和8中的bug,internet-explorer,mootools,Internet Explorer,Mootools,在mootools 1.3中,在Internet Explorer 7和8中查看时,以下代码会产生错误: new Element('div', {class: 'thumbBox'}); 错误如下: SCRIPT1028: Expected identifier, string or number 该错误指向上述代码中单词“class”的开头 帮忙?谢谢类是IE中的保留关键字,请将其放在语音标记/引号中 new Element("div", { "class": "foo",

在mootools 1.3中,在Internet Explorer 7和8中查看时,以下代码会产生错误:

new Element('div', {class: 'thumbBox'});
错误如下:

SCRIPT1028: Expected identifier, string or number 
该错误指向上述代码中单词“class”的开头


帮忙?谢谢

是IE中的保留关键字,请将其放在语音标记/引号中

new Element("div", {
    "class": "foo",
    id: "bar"
});
你可以这样写:

new Element("div#bar.foo");