Seems to be a bad idea to create html in javascript, templates maybe? mustache? @tanghus also wrote a templating engine iirc

Just noting :P