Use the genElt and writeElt functions in xbdhtml.js API (view or download), as explained in the TechNote on Setting CSSP Properties from JavaScript at: http://developer.netscape.com/docs/technote/dynhtml/csspapi/csspapi.html