Create Click to highlight feature

Discussion in 'Programming' started by IamNed, Nov 10, 2006.

  1. #1
    If you use adsense when you are given your ad code it is in a scrolling window box and when you click it all the html in that box is highlighted.

    How is that done?
     
    IamNed, Nov 10, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. IamNed

    IamNed Peon

    Messages:
    2,707
    Likes Received:
    276
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I see, but how do you put it all together?

    I found a website that gives some instructions

    codeave.com/javascript/code.asp?u_log=7004

    but I dont want a button. How do you do it so that when you click the text body al the text is sellected
     
    IamNed, Nov 10, 2006 IP
  4. IamNed

    IamNed Peon

    Messages:
    2,707
    Likes Received:
    276
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Nevermind I found it

    plus2net.com/javascript_tutorial/textarea-onclick.php
     
    IamNed, Nov 10, 2006 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    EDIT: Too late...

    
    <textarea onclick="this.focus(); this.select();"></textarea>
    
    HTML:
     
    nico_swd, Nov 10, 2006 IP