Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Cannot create element with a class, reserved keyword.

#2

A fixed version of your function, using cls to set the 'class' attribute.

var Element = function(type, atts, content) {

this.el = document.createElement(type);

for(var attr in atts) {
    if (attr == 'cls') {
        this.el.setAttribute('class', atts[attr]);
    } else {
        this.el.setAttribute(attr, atts[attr]);
    }
}

this.el.innerHTML = content || '';
return this.el;

};

Reported by deanoj · October 13th, 2010 @ 08:56 AM

State: new
Milestone: none
Assigned to: nobody

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.