Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: textarea

  1. #1
    me2
    me2 is offline
    New Coder
    Join Date
    Oct 2007
    Posts
    88
    Thanks
    8
    Thanked 3 Times in 3 Posts

    textarea

    How would you insert the default text in a textarea to include "</textarea>"

    like this
    Code:
    <textarea>
    randomcode..
    in the random code</textarea>
    more random code
    </textarea>
    I have seen it done but do not know how to do it..

  • #2
    Regular Coder
    Join Date
    Nov 2006
    Posts
    247
    Thanks
    13
    Thanked 26 Times in 24 Posts
    Code:
    <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.
    Last edited by Majoracle; 12-17-2007 at 10:55 AM.

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by me2 View Post
    Code:
    <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,
    best regards
    Last edited by oesxyl; 12-17-2007 at 10:53 AM.

  • #4
    Regular Coder oldcrazylegs's Avatar
    Join Date
    Feb 2004
    Location
    East Moline Illinois USA
    Posts
    414
    Thanks
    4
    Thanked 5 Times in 4 Posts
    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
    Last edited by oldcrazylegs; 01-16-2008 at 02:08 AM.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You really shouldn't be using document.write. There are much better alternatives that are part of the DOM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •