windowonload = function documentgetElementByIdchat-gpt-inputfocus;;documentaddEventListenertouchstart functionevent if eventtargetid === chat-gpt-input eventstopPropagation; documentgetElem
可以这样写:
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);
原文地址: https://www.cveoy.top/t/topic/YiG 著作权归作者所有。请勿转载和采集!