Typically when I put together dynamically generated HTML markup, I\'ve been using PHP to store the information and then looping through that to create elements on the page.
Best practice would be to produce any necessary markup on the server side. Reasons for this include:
SEO: Most crawler bots won't parse Javascript, so they'll skip over anything crucial that you're generating with addElement.
Accessibility: Your site should basically functional without Javascript. Consider people who might be browsing your site on Kindles, older Blackberries, Nokias or other feature phones with data. They don't need all the fancy styles and effects, but they should at least be able to get around your site.
Consistency: JS can add yet another level of cross-browser variability. Why rely on client-side rendering of necessary markup? Do it server-side.
Of course, this advice can be taken in stride if you're developing an all-JS desktop app or using something like the Sencha Touch framework.