Hacker News new | ask | show | jobs
by jacobr 5022 days ago
A simple helper function makes DOM manipulation non-painful as well. One example is https://gist.github.com/1532562 or my fork https://gist.github.com/3524145

It's used like this:

    el ( tagName, properties, children )
Working with data structures is easy, children is just an array which can be the results of something like data.map() turning the data into elements.
1 comments

This is very effective. After a while this is basically as writing html.

An added benefit is that it's very easy to attach events or other javascript properties to any object in the hierarchy.