开发者

document.getElementById("ID").focus() + Google Chrome

document.getElementById("ID").focus() n开发者_如何学Cot work in Google Chrome. Is there any alternative? Thank you.


If you're trying to focus something that can't normally be focused you might need to add a tabindex:

<span id="something" tabindex="0">Something</span>

document.getElementById("something").focus()


Apparently it does work, so I'd suggest that you verify that your ID is correct and that document.getElementById() is returning the element that you were expecting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜