[whatwg] createElement convenience method

Keryx Web webmaster at keryx.se
Sun Oct 21 13:57:56 PDT 2007


Křištof Želechovski skrev:
> Convenience methods such as the one proposed here should not make it to the
> standard for the sake of clarity and compatibility; the programmer can reuse
> an existing wrapper function instead:
> var link_to_add = createLink(link_text);
> This approach is safer and saner.
> Best regards,
> Chris

I beg to differ. Native functions speed things up. My suggestion is both 
sane and safe as it is.

This suggestion falls into the exact same category as 
getElementsByClassName.

A. There are existing functions that has similar abilities.

B. This is a very common and repetitive task.

C. Adding this won't break any current code.


Lars Gunther



More information about the whatwg mailing list