onLoad Focus input field not working in Apple Safari mobile

I use javascript function below to focus input field or textarea when the web page is loaded. It works well in case of standard Android mobile web browsers. But the solution is not working in Safari mobile web browser.

Do you have any suggestions how to apply focus effect on input field or textarea, when the website is loaded in Safari for smartphones ?

<body onLoad="javascript: document.getElementById("email").focus();">
<input type="text" name="emailaddress" id="email" />
</body>
0
give a positive ratinggive a negative rating
Share on FacebookShare on TwitterShare on LinkedInSend email
0 answers
x
x
2024 AnswerTabsTermsContact us