hi ,
using obj.innerHTML = "abcxyz <[email protected]>"
getting ouput: abcxyz the rest part is getting ignored because of angle bracket(<>).
so how to achieve the same.
thanks in advace
hi ,
using obj.innerHTML = "abcxyz <[email protected]>"
getting ouput: abcxyz the rest part is getting ignored because of angle bracket(<>).
so how to achieve the same.
thanks in advace
Actually, the content is still there, but the browser interprets it as unknown tag, that is, it does not display anything. Look at the generated page source (in FF, e.g., mark all text and use "Selection source" from the context menu).
Try quoting the brackets:
obj.innerHTML = "abcxyz <[email protected]>".replace (/</g, "<")
This, however, will replace all <
. If you want to embed other HTML, too, you will have to keep track on what you already encoded and what not.
Cheers,
In HTML, a literal "<" is represented as "<" and a literal ">" is represented as ">". See HTML 4.01 section 5.3.2.