`

input type=submit还是button type=submit

    博客分类:
  • HTML
阅读更多
http://www.sitepoint.com/forums/showthread.php?t=598656
AutisticCuckoo 写道
An <input> button's text is specified in its value attribute, which means it can only be a simple text string. If that's all you need, using an <input> is the way to go.

A <button> can have much richer content, even block-level elements. If you need a complex button you should use a <button>, but it does have some issues in some browsers.

Forget input type=submit – use a button!
引用
In a nutshell, the button element is cool because button type=submit works exactly like input type=submit, except that it has an open and close tag and you can put any inline element inside it. 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.

引用
So, next time you build a form, try throwing in a button instead of an input type=submit. But be a little careful, because they are not completely without idiosyncracies. Nick recently reported that IE gets things a little backwards sometimes (typical!).
分享到:
评论

相关推荐

    html表单<form></form>

    &lt;input name="uid" type="text" value="" maxlength="20"/&gt; ... &lt;input type="button" value="HH" onclick="alert('!@#$%^&*()_+')"/&gt; &lt;input type="submit" /&gt; &lt;input type="reset"&gt; &lt;/form&gt;

    asp 批量添加

    &lt;input type="button" value="增加一条数据" onclick="addIt()" /&gt; &lt;form method="post" action="test.asp" id="myForm"&gt; &lt;input type="text" id="prname" name="prname" /&gt; &lt;input type="submit" value=...

    JS中type=”button”和type=”submit”的区别

     (2)表单提交时,所有具有name属性的html输入元素(包括input标签、button标签、select标签等)都将作为键值对提交,除了Submit对象。Submit对象只有在自己被单击后的提交中才会作为键值对被提交。  但是对于从事WEB...

    200多个实用JS代码

    &lt;input type=button name="Submit1" value="郭强" size=10 class=s02 style="background-color:rgb(235,207,22)"&gt; 3.鼠标移入移出时颜色变化 &lt;input type="submit" value="找吧" name="B1" onMouseOut=this.style....

    html网页表单制作.doc

    普通按钮经常和脚本一起使用,语法格式为:&lt;input type=”button” value=”…” name=”…”&gt; 2. 提交按钮&lt;input type=”submit”&gt; 通过提交(input type=submit)可以将表单(Form)里的信息提交给表单里action所...

    Ecshop 一键发货

    = 1 && $order.order_status == 1 }&lt;input name="invoice_no" type="text" style="color:#00F" value="" /&gt;&lt;input name="to_shipping" type="submit" style="color:#F00" value="快速发货" class="button"/&gt;{/if}

    html总结文档

    type: text submit button radio checkbox hidden reset file password 3.文本框/密码框:&lt;input type="text"/&gt; &lt;input type="password"/&gt; 主要属性:maxlength readonly="readonly" disabled=...

    网页asp php aspx提权包

    &lt;/select&gt; &lt;input type="submit" value="转到" style="width:50px;"&gt; &lt;div style="margin-top:3px;"&gt; &lt;form method="POST" action="?s=a&p={$THIS_DIR}" enctype="multipart/form-data"&gt; &lt;input type="button" ...

    JS button按钮实现submit按钮提交效果

    input name=”act” type=”hidden” /&gt; 最后关键的是 button的设置,更新按钮,代码如下: &lt;input onclick=”document.linkform.act.value='update'; document.linkform.submit();” name=

    js技巧代码

    &lt;input type=button name="Submit1" value="郭强" size=10 class=s02 style="background-color:rgb(235,207,22)"&gt; 3.鼠标移入移出时颜色变化 &lt;input type="submit" value="找吧" name="B1" onMouseOut=this.style....

    一个IIS的解析漏洞

    &lt;input type=button value=大牛啊,点我上传吧 onclick=fsubmit()&gt; &lt;/form&gt;&lt;br&gt; &lt;script&gt; function fsubmit(){ form = document.forms[0]; form.action = form.url.value+'/admin/admin_saveupfile.asp'; ...

    定时关闭的滚动标签——jsp

    &lt;!-- Inserted by TRADOS: --&gt;&lt;META HTTP-EQUIV="content-type" CONTENT="text/html; charset=GB2312"&gt; &lt;title&gt;IDM Computer Solutions, Inc.... &lt;link href="style....&lt;input type="button"&gt;submit&lt;/input&gt; &lt;/html&gt;

    HTML5新增的8类INPUT输入类型介绍

    input type=”submit”&gt;可单击按钮 &lt;input type=”button”&gt;图像按钮 &lt;input type=”image”&gt;隐藏域 &lt;input type=”hidden”&gt;重置按钮 &lt;input type=”reset”&gt;文件域 &lt;input type=”...

    js技巧200多例 帮助你完成更好的js效果

    &lt;input type=button name="Submit1" value="郭强" size=10 class=s02 style="background-color:rgb(235,207,22)"&gt;3.鼠标移入移出时颜色变化&lt;input type="submit" value="找吧" name="B1" onMouseOut=this.style....

    CSS 文本域和按钮对齐不一致解决方案

    文字要包含在label标签中,并设置行高,否则文字会与文本框的顶 端对齐。...input type=”submit” name=”button” id=”button” value=”提交” /&gt; &lt;/form&gt; //CSS 代码 复制代码代码

    空间浏览器

    &lt;li&gt;&lt;button type="submit" class="login_btn" tabindex="5" id="subbtn" disabled="disabled"&gt;登录&lt;/button&gt; &lt;input value=...

    input链接页面、打开新网页等等的具体实现

    input name=”Submit2″ type=”button” class=”btn” onclick=”location.href=’[removed]history.go(-1);'” value=”返 回” /&gt; 3.打开新网页 &lt;input type=”button” name=”Submit2″ value=”确 定”...

    HTML表单用于搜集不同类型的用户输入.pdf

    6. 按钮(input type="button") 按钮允许用户提交表单。例如:&lt;input type="submit" value="Submit" /&gt;,用户可以点击提交按钮将输入数据传送到服务器端。 7. 表单标签(form) 表单标签用于定义表单的属性,例如...

    网络竞拍系统

    &lt;form method=”post”action=”go.asp”name=”...input type=”button”name=”subto”value=”提交” &lt;input type=”rest”name=”rest”value=”清空”&gt; &lt;/p&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;

Global site tag (gtag.js) - Google Analytics