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();
精彩评论