It's a problem when IE renders tags. I was using anchor tag with contentEditable = false property. When I tried using contentEditable = inherit the SPAN tags were coming correctly. So the lame piece of code is
onkeydown --- change all contentEditable properties to inherit
onkeyup --- change it back to false.
