...

View Full Version : textarea



me2
12-17-2007, 10:39 AM
How would you insert the default text in a textarea to include "</textarea>"

like this


<textarea>
randomcode..
in the random code</textarea>
more random code
</textarea>


I have seen it done but do not know how to do it..

Majoracle
12-17-2007, 10:45 AM
<textarea>
randomcode..
in the random code&lt;/textarea&gt;
more random code
</textarea>

&lt; prints a <
&gt; prints a >

It'll show as "</textarea>" inside the textarea without closing it.

oesxyl
12-17-2007, 10:47 AM
<textarea>
randomcode..
in the random code &lt; /textarea &gt;
more random code
</textarea>



I'm don't test this but I think it work, replace <, > with &lt; &gt;

PS: sorry for duplicate response with Majoracle, I can see your post only after I post mine... meantime I edit, :D
best regards

oldcrazylegs
01-16-2008, 01:58 AM
oesxyl -- it works fine. i use it all the time. also you can use


&# 60; for < and &# 62; for >

remove the space between # and 6 the server wouldn't allow me to put them together.

here is a tool i use for making html/xhtml examples
http://dwight.clickthesky.com/a/htmlexamplesmaker.htm

another one for making document.write scripts
http://dwight.clickthesky.com/a/docwritegen.htm

i got them from http://www.javascripts.com/ and http://www.about.com/javascripts

_Aerospace_Eng_
01-16-2008, 04:02 AM
You really shouldn't be using document.write. There are much better alternatives that are part of the DOM.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum