方法1:

GDScript3
1 行
<body onload="document.getElementById('inputId').focus()">

方法2:

JavaScript
3 行
function init(){
    document.getElementById("inputId").focus();
} 

例如:

GDScript3
3 行
<body onload="document.getElementById('test').focus()">
我要获取焦点:<input type="text" name="test" id="test">
</body>