This is my function set css attributes like as jquery
that.getNode = function() {
return element; // element is HTML node
};
that.css = function(obj) {
var node = that.getNode(),
attr;
if (node && node.style) {
for (attr in obj) {
if (obj.hasOwnProperty(attr) && node.style.hasOwnProperty(attr)) {
node.style[attr] = obj[attr];
}
}
}
return that;
};
Then I call, it runs on Chrome normally but can't work on IE9 or firefox
that.css({
border: "1px solid black"
});