Default type of <button>

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher Benson-Manica

    Default type of <button>

    According to http://www.w3schools.com/tags/tag_button.asp, the type
    attribute of the <button> tag is optional. Is the UA at liberty to
    choose any type it wishes if the attribute is omitted? Does the
    presence or lack of a DTD impact the answer?

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
  • David Dorward

    #2
    Re: Default type of &lt;button&g t;

    Christopher Benson-Manica wrote:
    [color=blue]
    > According to http://www.w3schools.com/tags/tag_button.asp, the type
    > attribute of the <button> tag is optional.[/color]

    W3Schools is rather error prone, in this case they are simply missing some
    information. Try the spec instead:

    type = submit|button|r eset [CI]
    This attribute declares the type of the button. Possible values:

    * submit: Creates a submit button. This is the default value.
    * reset: Creates a reset button.
    * button: Creates a push button.

    -- http://www.w3.org/TR/html4/interact/...ml#edef-BUTTON

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • Michael Winter

      #3
      Re: Default type of &lt;button&g t;

      On 01/07/2005 22:30, David Dorward wrote:
      [color=blue]
      > Christopher Benson-Manica wrote:
      >[color=green]
      >> According to [W3Schools], the type attribute of the <button> tag is
      >> optional.[/color][/color]

      [From the specification:]
      [color=blue]
      > * submit: Creates a submit button. This is the default value.[/color]

      It's worth pointing out two things, both related to IE:

      1. IE incorrectly assumes 'button' for the default value.
      2. IE gets the whole mechanics of the BUTTON element wrong
      when used for form submission.

      [snip]

      Mike

      --
      Michael Winter
      Replace ".invalid" with ".uk" to reply by e-mail.

      Comment

      Working...