Fixed HTML generation from JS