<按钮>与 <input type="button" 对比/>.使用哪个? [英] &lt;button&gt; vs. &lt;input type=&quot;button&quot; /&gt;. Which to use?

查看:27
本文介绍了<按钮>与 <input type="button" 对比/>.使用哪个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在查看大多数网站(包括 SO)时,大多数都使用:

When looking at most sites (including SO), most of them use:

<input type="button" />

代替:

<button></button>

  • 两者之间的主要区别是什么(如果有的话)?
  • 是否有正当理由使用一个而不是另一个?
  • 是否有充分的理由来使用它们?
  • 使用<button>是否会带来兼容性问题,看到它的使用不是很广泛?
    • What are the main differences between the two, if any?
    • Are there valid reasons to use one instead of the other?
    • Are there valid reasons to use combine them?
    • Does using <button> come with compatibility issues, seeing it is not very widely used?
    • 推荐答案

      • 这是一个页面 描述差异(基本上你可以将 html 放入 <button></button>)
      • 还有另一页描述人们为什么避免使用<按钮></button>(提示:IE6)
        • Here's a page describing the differences (basically you can put html into a <button></button>)
        • And another page describing why people avoid <button></button> (Hint: IE6)
        • 使用

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆