Empty Tags in Internet Explorer
In Case you were wondering…. <span class="replaceMe"></span> does not behave the same as <span class="replaceMe"/> in ie, even though they are semantically equivalent. The second option will cause sites to crash, and not render if using ajax calls to update them (in particular with Prototype, with the use of Element.replace, or event innerHTML).
So, even though <span class="replaceMe"></span> should be equivalent to <span class="replaceMe"/>. Don't use the later if you want dom manipulation to work (which is pretty much the main reason to use an empty span tag in the first place. The real moral to the story is Don't use empty span tags if you want to support the most popular browser on the planet.
June 17th, 2008 at 2:41 am
[…] Go to the author’s original blog: Empty Tags in Internet Explorer […]