<button> versus <input type=“image”>

前端 未结 3 853
耶瑟儿~
耶瑟儿~ 2021-01-04 10:18

This is for an \"Add to basket\" control for which one of my colleagues has designed a nice graphic. Obviously it should generate a post request, which a simple hyperlink i

3条回答
  •  耶瑟儿~
    2021-01-04 11:08

    They should be equivalent. For styling purposes, I find button tags are more flexible if you change things in the future.

    But: IE has a bug/feature where the value of a button or input is set to equal the innerHTML. This can cause problems if your server side code needs this to be a particular value.

    Unless you need the additional styling flexibility of

提交回复
热议问题