D
DKM
I have an empty tag like <p id="pid"></p> in a xml file. And, I have a
script as foolows:
str = "<b>Hello World!!!</b>";
ele = documeny.getElementById("pid");
ele.appendChild(document.createTextNode(str));
I expected to see "Hello World!!!" in bold letters, but instead I see
"<b>Hello World!!!</b>".
I tried replacing / with \/, but that did not help. Then I tried
replacing < with & lt ; and > with & gt ;, but that did not work, then
I tried replacing < with \u 003e and > with \u 003c, but that did not
work too. The exact string is being displayed instead of "Hello
World!!!" in bold letters.
There is no problem with html files. Both FireFox and IE display in
bold letters.
Any tip will be appreciated.
Thanks very much in advance.
D.K. Mishra
script as foolows:
str = "<b>Hello World!!!</b>";
ele = documeny.getElementById("pid");
ele.appendChild(document.createTextNode(str));
I expected to see "Hello World!!!" in bold letters, but instead I see
"<b>Hello World!!!</b>".
I tried replacing / with \/, but that did not help. Then I tried
replacing < with & lt ; and > with & gt ;, but that did not work, then
I tried replacing < with \u 003e and > with \u 003c, but that did not
work too. The exact string is being displayed instead of "Hello
World!!!" in bold letters.
There is no problem with html files. Both FireFox and IE display in
bold letters.
Any tip will be appreciated.
Thanks very much in advance.
D.K. Mishra