I've tried $('#field').focus(), and any other method found on the internet. Nothing worked. I have a simple html that reproduces the problem.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#field').focus();
});
</script>
</head>
<body>
<input type="text" id="field" name="field"/>
</body>
</html>
Please help!
#focus()method call within a browser event callback to see fi ti works that way? I don';t understand why the Android version of WebKit would deviate from the chrome version in this manner... it might help to have a case where it doesn't deviate from expected behavior in order to understand the case where it does.document.ready()? for instance:$(document).ready(function() { (function() {$('#field').focus();}); });Occasionally wrapping an action within an anonymous function subject to immediate execution solves random inexplicable JS issues.