How To Make Source Code Visible

HTML



 WHAT'S NEW 
 HTML FORUM 
 SITE MAP 
 REQUEST HELP 
 TRADE LINKS 
 FREE LINKS PAGE 






WEBMASTERS
Earn Money
Per Click!




SmallDot.com


BraveNet


TrafficSwarm


Submit9000


CodeBrain


Color Schemer


FlashBanger


123TurnKey.com


Web Page Templates


Dynamic Drive


Javascript Source


Javascript City


Javascript Kit


JavaPowered


FreewareJava
Home
General
HTML
Java Applets
Javascript
Wizards
Contact


The Html Help Guide


Displaying Source Code



    There may come a time when you will need to display some html source code on a web page. Possibly for allowing someone to place your banner or button on their site. Whatever the reason, this is a simple process. Here are two methods.


Method One:
This will display the source code directly on the page. Simply replace every < with &lt; and every > with &gt;

Example: To display this source code.

<a href="http://www.somesite.com/mysite/><img src="http://www.somesite.com/mysite/banner.gif" width="468" height="60" border=0 alt=""></a> You would use.

&lt;a href="http://www.somesite.com/mysite/&gt;&lt;img src="http://www.somesite.com/mysite/banner.gif" width="468" height="60" border=0 alt=""&gt;&lt;/a&gt;


Method Two:
This method is best for displaying javascripts because it keeps the correct formatting of the script. The source code will appear in a text area box. This one even includes a "Highlight All" button.

<form>
<input type=button value="Highlight All" onClick="javascript:this.form.txt.focus();this.form.txt.select();"&gt;&nbsp;&nbsp;&nbsp;&nbsp;<br>
<TEXTAREA NAME="txt" ROWS="12" COLS="60">
Source code would go here.
</TEXTAREA>
</form>


Example:

    



Join the Html Help Guide mailing list
Enter your email address.
Subscribe    Unsubscribe