Html里的标签<button>

大家一般写按钮, 都会写<input type=”button” value=”按钮文字” />

但是还有一个标签可以用就是<button></button>, 两者功能一样, 但是button的功能更丰富

这个标签里面允许定义其他html标签作为按钮文字

例如:

<button><img src=”some.gif” /></button>

<button><strong>这是加粗的文字</strong></button>

<button>是标准的html元素, 可以放心使用

但是<button>也有麻烦的地方, 就是用button提交form的时候不会触发form的onsubmit事件.

Button的问题, 请参考深入理解 __doPostBack

Share
This entry was posted in 编程. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">