What is the difference between onBlur and onChange attribute in HTML?

前端 未结 7 1505
[愿得一人]
[愿得一人] 2020-11-29 18:18

When is one called versus the other? Is there a situation were onChange would be called but onBlur would not be called?

7条回答
  •  误落风尘
    2020-11-29 18:45

    onBlur is when your focus is no longer on the field in question.

    The onblur property returns the onBlur event handler code, if any, that exists on the current element.

    onChange is when the value of the field changes.

提交回复
热议问题