Reseting a form when you click it?

Discussion in 'JavaScript' started by crazyryan, Apr 7, 2007.

  1. #1
    How would I achieve this:

    If I had a search box that said "Type your query here" and a user clicked on it, that text would disappear for them.

    I've seen it on sites like www.break.com and others.
     
    crazyryan, Apr 7, 2007 IP
  2. walesalex

    walesalex Peon

    Messages:
    552
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    onfocus="this.value='';"

    Just stick that attribute in there.
     
    walesalex, Apr 7, 2007 IP