alt attribute for input tag

Discussion in 'HTML' started by =?iso-8859-1?Q?Marcel_St=F6r?=, Nov 28, 2003.

  1. Hi all,

    Why would the browser not produce a nice tooltip saying "hello" if I move
    the cursor over the checkbox?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>

    <body>
    <input name="test" type="checkbox" value="1" alt="hello"/>
    </body>
    </html>

    The code is valid XHTML...

    Regards,
    Marcel
    =?iso-8859-1?Q?Marcel_St=F6r?=, Nov 28, 2003
    #1
    1. Advertising

  2. =?iso-8859-1?Q?Marcel_St=F6r?=

    brucie Guest

    in post <news:3fc743b4$0$242$>
    Marcel Stör said:

    > Why would the browser not produce a nice tooltip saying "hello" if I move
    > the cursor over the checkbox?


    because its not supposed to. use title="blah"


    --
    brucie
    brucie, Nov 28, 2003
    #2
    1. Advertising

  3. "brucie" <> schrieb im Newsbeitrag
    news:bq7gqk$1vbtg1$-berlin.de...
    > in post <news:3fc743b4$0$242$>
    > Marcel Stör said:
    >
    > > Why would the browser not produce a nice tooltip saying "hello" if I

    move
    > > the cursor over the checkbox?

    >
    > because its not supposed to. use title="blah"


    Hhmm, according the XHTML DTD there is an "alt" attribute for an "input"
    tag. However, the spec doesn't talk about titles for input elements...

    Regards,
    Marcel
    =?iso-8859-1?Q?Marcel_St=F6r?=, Nov 28, 2003
    #3
  4. =?iso-8859-1?Q?Marcel_St=F6r?=

    Chris Morris Guest

    Marcel Stör <marcel at frightanic dot com> writes:
    > "brucie" <> schrieb im Newsbeitrag
    > news:bq7gqk$1vbtg1$-berlin.de...
    > > in post <news:3fc743b4$0$242$>
    > > Marcel Stör said:
    > >
    > > > Why would the browser not produce a nice tooltip saying "hello" if I

    > move
    > > > the cursor over the checkbox?

    > >
    > > because its not supposed to. use title="blah"

    >
    > Hhmm, according the XHTML DTD there is an "alt" attribute for an "input"
    > tag. However, the spec doesn't talk about titles for input elements...


    title is a 'common' attribute. If you follow the DTD around a bit
    it's there.

    <input alt="..."> is only used by (some) browsers on <input
    type="image"> as far as I know.

    Anyway, 'alt' means alternative, so it only gets displayed when the
    "primary" isn't. A checkbox can always be displayed by a browser in
    the "primary" sense. Exactly what it looks like may vary, obviously.

    'title' is for supplementary information, and a lot of popular
    graphical browsers do display it on hover.

    --
    Chris
    Chris Morris, Nov 28, 2003
    #4
  5. =?iso-8859-1?Q?Marcel_St=F6r?=

    Steve Pugh Guest

    Marcel Stör <marcel at frightanic dot com> wrote:

    >Why would the browser not produce a nice tooltip saying "hello" if I move
    >the cursor over the checkbox?


    The purpose of alt attributes is not to create tooltips. The fact that
    some browsers do should not be taken as an indication that it will
    always happen.

    ><input name="test" type="checkbox" value="1" alt="hello"/>
    >
    >The code is valid XHTML...


    The alt attribute exists on input for the purpose of providing an
    alternative to the input when the input can not be displayed.
    In practice this almost always means as an alternative to the image in
    <input type="image"> when images can not be displayed.

    But there may be circumstances when a browser can't display your
    checkbox and would display the alt attribute instead.

    title is also a valid attribute of input (and most other elements) and
    is intended for additional but unimportant information.
    This may be displayed as a tooltip browser or may be made available to
    the user in some other way.

    If the information is important then you should include it in the page
    itself and not rely on browsers that may or may not display a tooltip
    under some circumstances.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Nov 28, 2003
    #5
  6. brucie wrote:

    Brucie! You're back?
    Owen Jacobson, Nov 28, 2003
    #6
  7. =?iso-8859-1?Q?Marcel_St=F6r?=

    brucie Guest

    in post <news:M8Ixb.195315$jy.166158@clgrps13>
    Owen Jacobson said:

    > Brucie! You're back?


    no, you're imagining things. go back to sleep and stop taking all the
    blankets.

    --
    brucie
    brucie, Nov 28, 2003
    #7
  8. =?iso-8859-1?Q?Marcel_St=F6r?=

    PeterMcC Guest

    OT [Re: alt attribute for input tag]

    brucie wrote:
    > in post <news:3fc743b4$0$242$>
    > Marcel Stör said:
    >
    >> Why would the browser not produce a nice tooltip saying "hello" if I
    >> move the cursor over the checkbox?

    >
    > because its not supposed to. use title="blah"


    Hi, brucie - good to hear from you.

    --
    PeterMcC
    If you feel that any of the above is incorrect,
    inappropriate or offensive in any way,
    please ignore it and accept my apologies.
    PeterMcC, Nov 28, 2003
    #8
  9. Marcel Stör <marcel at frightanic dot com> wrote:

    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


    Unnecessary in HTML
    <http://www.w3.org/International/O-HTTP-charset.html>
    <http://ppewww.ph.gla.ac.uk/~flavell/charset/ns-burp.html>
    and pointless in XHTML
    <http://ppewww.ph.gla.ac.uk/~flavell/charset/checklist.html#xhtml>

    Specify the encoding ("charset") via the HTTP header.
    Andreas Prilop, Nov 28, 2003
    #9
  10. Marcel Stör wrote:
    > Hhmm, according the XHTML DTD there is an "alt" attribute for an "input"
    > tag. However, the spec doesn't talk about titles for input elements...


    http://www.w3.org/TR/html4/interact/forms.html#h-17.4 Look under
    "Attributes defined elsewhere".
    Leif K-Brooks, Nov 28, 2003
    #10
  11. =?iso-8859-1?Q?Marcel_St=F6r?=

    Sid Ismail Guest

    On Sat, 29 Nov 2003 00:19:03 +1000, brucie <>
    wrote:

    : > Brucie! You're back?
    :
    : no, you're imagining things. go back to sleep and stop taking all the
    : blankets.
    :
    : --
    : brucie


    He only shows up on Turkey, Guy Fawkes, and Halloween... Hi Brucie!!!

    Sid
    Sid Ismail, Nov 28, 2003
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    792
    John C. Bollinger
    Jan 27, 2006
  2. Thomas Fuchs

    IMG ALT Attribute with Mozilla

    Thomas Fuchs, Apr 17, 2005, in forum: HTML
    Replies:
    6
    Views:
    4,524
    Tonnie
    Apr 17, 2005
  3. David Wright

    input attribute for the input tag?

    David Wright, Dec 19, 2006, in forum: HTML
    Replies:
    1
    Views:
    336
    Jukka K. Korpela
    Dec 20, 2006
  4. Lsimmons5
    Replies:
    63
    Views:
    6,655
    Neredbojias
    Jun 8, 2007
  5. Adrienne Boswell

    Alt attribute woes

    Adrienne Boswell, Mar 17, 2011, in forum: HTML
    Replies:
    8
    Views:
    487
    William Gill
    Mar 18, 2011
Loading...

Share This Page