input type=submit还是button type=submit

[url]http://www.sitepoint.com/forums/showthread.php?t=598656[/url]
[quote="AutisticCuckoo"]An <input> button's text is specified in its value attribute, which means [color=red]it can only be a simple text string.[/color] If that's all you need, using an <input> is the way to go.

[color=red]A <button> can have much richer content, even block-level elements[/color]. If you need a complex button you should use a <button>, [color=red]but it does have some issues in some browsers.[/color][/quote]
[url="http://kay.smoljak.com/index.php/forget-input-typesubmit-use-a-button/"]Forget input type=submit – use a button![/url]
[quote]In a nutshell, the button element is cool because button type=submit works exactly like input type=submit, [color=red]except that it has an open and close tag and you can put any inline element inside it.[/color] So you can put an image, or some text, or even a Flash movie were you so inclined, and style it however you like without all the odd behaviour that you get with input type=submit or input type=image.[/quote]
[quote]So, next time you build a form, try throwing in a button instead of an input type=submit. [color=red]But be a little careful, because they are not completely without idiosyncracies. Nick recently reported that [/color][url="http://nickcowie.com/2006/the-button-element-and-ie/"]IE gets things a little backwards sometimes[/url] (typical!).[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值