开发者

How can I find the first textbox in a container using Javascript?

I want to us开发者_StackOverflowe javascript to find the first textbox in a container, so I can set it to focused, but the textbox could be nested. Is there an easy way I can cycle through until I come across the first textbox?


document.getElementById('container').getElementsByTagName('textarea')[0].focus();

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜