Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

How To Focus Div

Recommended Posts

I have various divs flowing around in my page whereonkeydown event handlers are assigned.Is there any way I can set focus to a div or at leastcontrol who has focus when one looses it (blur ?). Inmy special case i present a list of database resultsafter the user entered some search data. To avoidusing the mouse I want the user to be able to selectthe record by siply hitting the Keybord. How can I movefocus form the textox to the table or div ??

Share this post


Link to post
Share on other sites

I dont think I understood everything, could you post a link to the website? From my point of view you have the answer yourself, Im not an advanced js programmer but i think that if you set those 'onkeydown' events for different keys, you can tell js to set the focus to the div you want, I think it would be something like this:setfocus(document.myform.yerDiv)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.