Fotiman - 3:19 pm on Oct 22, 2010 (gmt 0)
With all that said, I would suggest that innerHTML is not a good solution in this particular case, and that using DOM methods to append the element (as you posted as the cure in your example) is a better approach. If you need to modify the DOM properties of an element (that are not mapped to specific HTML attributes), then you will need to do more than just modify innerHTML. And if you're going to do that, then you might as well just use the DOM methods for appending the element as well. And any time you will be REPLACING existing elements by setting innerHTML, special care needs to be taken to ensure that the elements you're replacing don't have DOM properties that need to be preserved.