Set focus on the top of the page when getting the error

while click on submit button, calling the integration call. If any error is occured then we should display the error message on the top of page. I have displayed the message on top of the page. But focus is in bottom of the page. Is there any way to scroll to top of the page or set the focus to top of the page automatically.

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data