可以这样写:

window.onload = function() { document.getElementById("chat-gpt-input").focus(); };

document.addEventListener('touchstart', function(event) { if (event.target.id === 'chat-gpt-input') { event.stopPropagation(); document.getElementById('chat-gpt-input').focus(); return false; } }, false);

windowonload = function documentgetElementByIdchat-gpt-inputfocus;;documentaddEventListenertouchstart functionevent if eventtargetid === chat-gpt-input eventstopPropagation; documentgetElem

原文地址: https://www.cveoy.top/t/topic/YiG 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录