469,926 Members | 1,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

how to set focus on html dropdown list in safari?

I have a text field on which when characters are entered a drop down list appears. At that point, I want to shift focus to the drop down.

I used following code to set the focus.
document.getElementById('<dropdownid>').focus()

However, focus is not being set first time. When I use backspace to delete the contents in the text box and enter the same character second time in text box, focus get set in drop down. This peculiar behaviour only occurs in safari. It works normal in IE.

Please provide me some inputs.
Oct 14 '10 #1
0 1255

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Ian Davies | last post: by
2 posts views Thread by starbuck | last post: by
3 posts views Thread by RJN | last post: by
13 posts views Thread by ujjc001 | last post: by
11 posts views Thread by eureka | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.