Construct HTML elements from objects