Painless Node Creation with DOM Builder
By Jeremy Keith | April 14th, 2006 | Filed in Authoring Tools, DOM, DOM Scripting TF
Dan Webb’s DOM Builder takes the finickiness out of standards-based markup generation.
Skip to comment formIf you haven’t seen it yet, be sure to read the latest post over on the Vivabit blog. In it, Dan Webb debuts a small but perfectly formed little script that solves a problem familiar to many of us.
The innerHTML
property is quick and easy to use. But it’s also proprietary and heavy-handed. DOM methods like createElement
and createTextNode
, on the other hand, are precise and part of a standard but they can be finicky and repetitive to use.
Dan’s script takes the finickiness out of standards-based markup generation while keeping the precision. The 1K file is called DOM Builder and it could prove to be a very useful addition to your DOM Scripting arsenal.
The script has been released under an MIT license.