Avoid use of innerHTML with dynamic markup