Difference between input and button markup

We all know input markup in XHTML, which can be used to create TextBox, Button, CheckBox, RadioButton, HiddenField etc via type attribute. There are three types of button, one is used to submit form, another is used to reset form, the third one has no default actions, which should be enhanced by JavaScript.

There is another markup usded to present a button is button, following is found in the W3C site:

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.

Now it’s the example time to use button markup to create an image button:

<button type="submit">
    <img src="mini/alert.gif" mce_src="mini/alert.gif" alt="" />
    Image
</button>
posted @ 2009-05-11 15:18  三生石上(FineUI控件)  阅读(386)  评论(0编辑  收藏  举报