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, 09:45 AM
<textarea>
randomcode..
in the random code</textarea>
more random code
</textarea>
< prints a <
> prints a >
It'll show as "</textarea>" inside the textarea without closing it.
oesxyl
12-17-2007, 09:47 AM
<textarea>
randomcode..
in the random code < /textarea >
more random code
</textarea>
I'm don't test this but I think it work, replace <, > with < >
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, 12: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, 03:02 AM
You really shouldn't be using document.write. There are much better alternatives that are part of the DOM.