Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write a tag html as a string with javascript?

 
Giulietta Blumarine
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I want to write for example the folling string "<B><////></table>" with "document.write" of javascript without browser reads it as a tag html .....
I want to read the tag on the screen!!!

Can somebody help me?

Thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
escape the characters.

replace < with &lt; and > with &gt;

Eric
 
Giulietta Blumarine
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much!
I have replace the text I have to write in this way:

temp = temp.replace(/>/g,">");
temp = temp.replace(/</g,"<");

Giu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic