Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> How To Focus Div
kvarnerexpress
post Feb 5 2006, 03:41 PM
Post #1


Super Member
*********

Group: Members
Posts: 407
Joined: 13-December 04
Member No.: 2,696



I have various divs flowing around in my page where
onkeydown event handlers are assigned.

Is there any way I can set focus to a div or at least
control who has focus when one looses it (blur ?). In
my special case i present a list of database results
after the user entered some search data. To avoid
using the mouse I want the user to be able to select
the record by siply hitting the Keybord. How can I move
focus form the textox to the table or div ??
Go to the top of the page
 
+Quote Post
Lozbo
post Feb 8 2006, 10:46 PM
Post #2


Super Member
*********

Group: Members
Posts: 282
Joined: 1-September 05
From: Wanatos
Member No.: 11,382



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)
Go to the top of the page
 
+Quote Post
iGuest
post Jun 3 2008, 09:55 AM
Post #3


Hail Caesar!
*********************

Group: Members
Posts: 5,876
Joined: 21-September 07
Member No.: 50,369



Setting focus on div.
How To Focus Div

So simple in jQuery

$("#myDiv").Focus();

-reply by Aamir Afridi
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Why Can't I Focus And I Hate My Parents.(13)
  2. Hackers Focus Efforts On Firefox, Safari, And Office(1)
  3. Shoot A Pic, Focus Later(11)
  4. Adding Accessibility Features To Your Pages(0)
  5. Focus On Keyword Content(1)
  6. How To Focus(11)
  7. Stop A Window From Loosing Focus?!?(1)


 



- Lo-Fi Version Time is now: 13th October 2008 - 05:58 AM