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 4 of 4
  1. #1
    Regular Coder zro@rtv's Avatar
    Join Date
    Feb 2005
    Location
    on the network
    Posts
    433
    Thanks
    0
    Thanked 1 Time in 1 Post

    this.select on pre?

    So appearently I cannot use
    Code:
    onclick="this.select"
    on any element other than textareas?

    Any workaround to do this on a 'pre' tag?
    or any feelings on this?
    am i not thinking about this correctly?
    ._-zro
    zro@redtv
    zro.redtv.org

    "If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"
    -Tim Berners-Lee, Weaving the Web, 1999

  • #2
    New Coder
    Join Date
    Dec 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What are you trying to do?

  • #3
    Regular Coder zro@rtv's Avatar
    Join Date
    Feb 2005
    Location
    on the network
    Posts
    433
    Thanks
    0
    Thanked 1 Time in 1 Post
    ya, sry... wasnt very specific.

    http://r6.killerb.net/
    thats the page im working on.

    http://r6.killerb.net/js/clicks.js
    is the js im using.

    basically i have bunch of 'snippets', and i wanna have them highlight (for easy copying) when you click them.

    Currently I hav jsut switched from pre to textarea, but it seems more semantically sound for them to be pre, but i guess its no big deal.

    lemme kno what people think.
    ._-zro
    zro@redtv
    zro.redtv.org

    "If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"
    -Tim Berners-Lee, Weaving the Web, 1999

  • #4
    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
    Both text areas and pres keep their formatting. I would use a textarea for what you want to do. Only thing you might want to do is run the snippets through some server side script that converts < and > to html entities. Just make the textareas readonly so users can't accidently erase them.
    ||||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
    •