Tech Off Post

Single Post Permalink

View Thread: More ECMAScript fun!
  • User profile image
    Maurits

    MSDN article on <button>'s type attribute... IE does recognize it, but there are two caveats:

    1) The property is read-only... no changing it from the DOM.
    2) The default value is not type="submit", but type="button".

    The first caveat is a minor annoyance.
    The second caveat is an out-and-out violation of the spec.

    Perhaps something like
    if (b.type != "button") { b.type = "button"; } // stupid IE makes this read-only

    is the safest way to go?