Empty Tags in Internet Explorer

Published by Rob on June 16th, 2008 - in Development

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.

Related posts:

  1. Internet Explorer source editor…..
  2. The internet is a great place
  3. HTTP Authentication in a URL
  4. My Second Month at Ephox
  5. Pretty URLs for any J2EE framework

One Response

  1. [...] Go to the author’s original blog: Empty Tags in Internet Explorer [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© Rob@Rojotek