Input Onclick

Discussion in 'HTML & Website Design' started by mab, Nov 20, 2008.

  1. #1
    Hello guys.
    Well i have a question about making a text disappear from an input text .. such as search boxes sometimes.

    Ex: digg.com
    In the right top in the box is written search digg... when you click it, it will disappear.

    How this was made?
    I really appreciate your help :)
     
    mab, Nov 20, 2008 IP
  2. ariefsyu

    ariefsyu Active Member

    Messages:
    192
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    simple
    <input name="something" onfocus="this.value=''" value="search this">
    Code (markup):
    cheers.
    Arief
     
    ariefsyu, Nov 20, 2008 IP
  3. vicky1408

    vicky1408 Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Arief is correct,except the closing tag.

    <input name="something" onfocus="this.value=''" value="search this" />
     
    vicky1408, Nov 21, 2008 IP
  4. ariefsyu

    ariefsyu Active Member

    Messages:
    192
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    vicky : thanks for correcting :) xhtml standard

    arief
     
    ariefsyu, Nov 21, 2008 IP
  5. vicky1408

    vicky1408 Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you are welcome
     
    vicky1408, Nov 21, 2008 IP