Object Focus problem with Safari and Chrome browsers

前端 未结 5 2151
野的像风
野的像风 2020-12-17 23:22

I have the following javascript being called to request a focus when page is loaded.

This code works 100% OK with Firefox and IE7, but Chrome and Safari do not seem

5条回答
  •  难免孤独
    2020-12-17 23:54

    Ensure this code is being called after the entire page has been rendered. It's probably being called above the HTML it refers to, so the element will not exist yet.

    Various JavaScript frameworks have utilities to tell you when the DOM is ready.

提交回复
热议问题