This is wrong on so many levels. Why are you injecting static HTML elements via JS instead of predefining them in the HTML and switching them to visible when the time comes?