Validation in HTML5. :invalid classe after submit

前端 未结 9 2444
清歌不尽
清歌不尽 2021-02-18 14:11

I\'m building a form and I want to use the :invalid selector to give the \"required\" input fields a red border if the user presses submit without filling them, but

9条回答
  •  北海茫月
    2021-02-18 14:42

    Very simple just use #ID:invalid:focus

    This only does the validation when focused on and not on page load

提交回复
热议问题