input type="button"和button的区别


<input id="btn1" type="button"/>不是双边标签,标签中间的内容不能自定义,按钮的提示只能通过value属性提示

<button id="btn2"></button>中间可以自定义,比如在中间加入<img />,可以得到一个图片按钮

<button></button>的功能明显比<input type="button">更多

修改input类型的按钮值得用("#btn1").value(str),修改button类型的按钮的值用("#btn2").html(str)



猜你喜欢

转载自blog.csdn.net/qq_23350817/article/details/84066978
今日推荐