Attribute Driven Template with Javascript