input type=“text” vs input type=“search” in HTML5

前端 未结 10 1684
無奈伤痛
無奈伤痛 2021-01-30 12:05

I\'m new to HTML5 as begun to work with HTML5\'s new form input fields. When I\'m working with form input fields, especially and

10条回答
  •  醉酒成梦
    2021-01-30 12:47

    There's browser difference in action, when you type some words then keyed ESC in input type="search" in chrome/safari the input box will get cleared. but in type="text" scenario, the words will not get cleared. So be careful choosing the type especially when u use it for autocomplete or search related feature

提交回复
热议问题