Hello,
Full credit to: Matthew Foster for the code below.  I'd like an
explanation of the below.  I'm having some troubles with Object extend
and would like a better explanation of the magic that occurs below.


$C = function(name, options) {
    return Element.extend(Object.extend(document.createElement(name ||
"div"), options || {}));
}


Sample use:
var next = $C("td", { innerHTML: ">", className: "next" });

So how are the properties innerHTML and className morphed on to this
new td element?

Thanks,
Karl..

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to