Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

printing "<html>" using html

How do I print the "html" tag, including '<' and '>'? How can I do this for any tag, without using text areas and Javascript?

like image 515
Jagan Avatar asked Aug 17 '10 17:08

Jagan


People also ask

How do I create a print page in HTML?

Developer ToolsThe DevTools ( F12 or Cmd/Ctrl + Shift + I ) can emulate print styles, although page breaks won't be shown. In Chrome, open the Developer Tools and select More Tools, then Rendering from the three-dot icon menu at the top right. Change the Emulate CSS Media to print at the bottom of that panel.

How do I print a webpage as appears?

The simplest of those methods is to press the Print Screen key (or Alt+Print Screen) in Windows, or either Command+Shift+3 or Command+Shift+4 on a Mac.

How do I display HTML code without executing?

Use HTML Special Character Codes var myCode = "<b>This is not bold</b>"; $('span#code-span'). text(myCode); Using text instead of html will cause tags to be rendered exposed instead of being executed.


2 Answers

Use HTML character references:

&lt;html&gt; 

Should output

<html> 
like image 91
driis Avatar answered Sep 18 '22 09:09

driis


Try doing:

&lt;html&gt; 
like image 32
D'Arcy Rittich Avatar answered Sep 17 '22 09:09

D'Arcy Rittich