Reputation: 210455
What was the intended purpose of the HTML <input type="button">
element, taking into account that Javascript appeared after HTML (hence making me doubt that JS was the intended purpose)?
Upvotes: 10
Views: 455
Reputation: 133577
Not sure but, if I remember correctly, <input type="button">
has been added with HTML4.0. Its first draft was from 1997, so 2 years later ECMAScript. So probably is has been introduced exactly for JS purposes.
Take a look to these links provided in comments by Felix Kling:
type=button
listed)Upvotes: 11
Reputation: 1437
They only make sense with javascript, otherwise they wont do much in a form. is supported since HTML4 in Netscape 2.x and Internet Explorer 3.x. Netscape Navigator had javascript support since version 2.0 (1995), so yes, they have been around since the same time that javascript was supported and are useless without js. My guess is that they included it so your forms and fields can get a uniform look & feel.
Upvotes: 0
Reputation: 2948
Well, according to the spec http://www.w3.org/TR/html4/interact/forms.html#h-17.5
Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content. For example, a BUTTON element that contains an image functions like and may resemble an INPUT element whose type is set to "image", but the BUTTON element type allows content.
Visual user agents may render BUTTON buttons with relief and an up/down motion when clicked, while they may render INPUT buttons as "flat" images.
Upvotes: -4