Site Navigation

Tuesday, July 8, 2008

bug 140 - changing mailto: links error in IE

Issue: #140
Affects: IE6, IE7, IE8 Beta 1, IE8 Beta 2, IE8 PR1, IE8 RC1

If you've ever wanted to set the href attribute of a link (a element) to a URL that uses the mailto: protocol, beware...

In IE, if you set this href attribute to "" or any other string that contains the "mailto:" protocol and the @ symbol, IE will overwrite the content of the a element.


<a id="contactLink" href="">
Send us your thoughts!
<script type="text/javascript">
var cL = document.getElementById('contactLink');

//this fails in IE
cL.href = '';

//this also fails in IE

Using the code above, would transform the link from this:
Send us your thoughts!
to this:

Known Workarounds: None.

Related Issues: None.

Bug/Site Feedback |
Submit a bug