Click to See Complete Forum and Search --> : printing out javascript code


IRON_NOODLE
03-25-2003, 03:57 PM
hi forgive me for this stupid question, but how do u print a javascript code on the screen. im making a tutorial page on the basics of javascripting and i need to make it show the code.

nkaisare
03-25-2003, 04:02 PM
<A href="whatever.html" onmouseover="blah" onmouseout="blah">Ah! Java Magic</A>

or

<pre><A href="whatever.html" onmouseover="blah" onmouseout="blah">Ah! Java Magic</A></pre>

Is this what you were asking?

IRON_NOODLE
03-25-2003, 04:07 PM
thanx:D

pyro
03-25-2003, 04:44 PM
Originally posted by nkaisare
<pre><A href="whatever.html" onmouseover="blah" onmouseout="blah">Ah! Java Magic</A></pre>
This doesn't do what you think it does...

nkaisare
03-25-2003, 05:22 PM
Yes you are right. "Ah! Java Magic" will be displayed as a link.
Thanks
Niket

pyro
03-25-2003, 05:45 PM
No problem ;)

What <pre> does is perserve the whitespace in your code.