Show code

liunx

Guest
How would i go about showing html code on a page, i don't want to run the code, just show it to users?<br />
Thanks.<!--content-->I usually put the code into a textarea, with the attribute of "readonly".<br />
<br />
I can also make this non editable for netscape, if you need.<!--content-->Use xmp TAGS<br />
<br>Code:<br><br />
<xmp><br />
<table width="100%" border="1" cellspacing="2" <br />
cellpadding="2" bgcolor="#008080" bordercolor="#d50015"><br />
<tr><br />
<td bgcolor="#d50015"><br />
update<br />
</td><br />
<td ><br />
<h2><center>My Homepage</center></h2><br />
</td><br />
<td ><br />
email<br />
</td><br />
</tr><br />
</table><br />
</xmp><br />
<br />
Or whole the page:<br />
<script type="text/javascript" language="JavaScript"><!--<br />
document.writeln('<table border="1" cellpadding="6" cellspacing="0" bgcolor=khaki><tr><td>');<br />
document.writeln('<a href=http://www.htmlforums.com/archive/index.php/"view-source:' + location.href + '">View Source Code</a>');<br />
document.writeln('</td></tr></table>');<br />
//--></script><!--content-->Thanks for the help guys.<!--content-->You would use < for < and > for ><!--content-->The < and > are OK if used a short code.<br />
But the xmp TAGS work great at a long one.<!--content-->Just suggesting the old fashioned way.<!--content-->
 
Back
Top