Have you ever tried to set an anchor tag's
Now, try executing the following in IE:
What would you expect to be the value of
link.innerHTML? Turns out that it is the same as the href value, 'http://flatterline.com'. It seems that, on IE only, if the inner HTML of an anchor tag looks like a URL, then upon replacing the href, it will also replace the inner HTML. Try the same experiment, but with link text that does not look like a URL:
Inspecting the innerHTML value will show that it was not replaced.
What do you think? Have a different workaround or solution?
Need web application development, maintenance for your existing app, or a third party code review?
Velocity Labs can help.Hire us!