One of the more common approaches is to use the createElement, setAttribute, and appendChild methods of the DOM. There are a number of resources describing these methods, one of my preferred is the open source mozilla project developer pages. [developer.mozilla.org...]