Using DOM methods to create elements and add properties is faster, less hackable, and less error prone than generation from a string.