I have a form at bottom of the page in my plugin on user profile page. Every time I submit the form, there will be a message box which is a <div> displaying the message.
But when I submit the form, it will call redirec() to refresh the page and then the focus will be set to the top of the page so that I have to scroll to the bottom to see the message box. It's not user-friendly so I wanna use js to set fucos to the message box after refreshing the page.
How can I call my js function set_focus() when refreshing the page? I cannot find a way to set this function to onload() of <body>.
Any advice? Thanks !