Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Apr 2007
Posts: 1,109
Reputation: cguan_77 has a little shameless behaviour in the past 
Solved Threads: 91
cguan_77's Avatar
cguan_77 cguan_77 is offline Offline
Veteran Poster

Link with Focus

 
0
  #1
26 Days Ago
hi guys, just want to ask if it is possible to check which link on the page receives a focus? For example, i got Links name A1, A2, A3, A4 and A5. How to check which link is currently receiving the focus? is it possible to do? thanks ...
Last edited by cguan_77; 26 Days Ago at 7:07 am.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 54
Reputation: chandru7 is an unknown quantity at this point 
Solved Threads: 9
chandru7 chandru7 is offline Offline
Junior Poster in Training
 
0
  #2
26 Days Ago
Try like this while loading the page for all links

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. if(A1.focus == true)
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 17
Reputation: futingkiller is an unknown quantity at this point 
Solved Threads: 2
futingkiller futingkiller is offline Offline
Newbie Poster
 
0
  #3
26 Days Ago
Originally Posted by cguan_77 View Post
hi guys, just want to ask if it is possible to check which link on the page receives a focus? For example, i got Links name A1, A2, A3, A4 and A5. How to check which link is currently receiving the focus? is it possible to do? thanks ...
there is a event called onfocus.... add that to the links and a function that tells you what was focused...
read more about that here:
http://www.w3schools.com/tags/tag_a.asp
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
0
  #4
26 Days Ago
Originally Posted by cguan_77 View Post
hi guys, just want to ask if it is possible to check which link on the page receives a focus? For example, i got Links name A1, A2, A3, A4 and A5. How to check which link is currently receiving the focus? is it possible to do? thanks ...
someLink.onfocus=doYourThing

Where "doYourThing" is the function you want to invoke when that paricular link has recieved focus.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 17
Reputation: futingkiller is an unknown quantity at this point 
Solved Threads: 2
futingkiller futingkiller is offline Offline
Newbie Poster
 
0
  #5
26 Days Ago
Originally Posted by Troy III View Post
someLink.onfocus=doYourThing

Where "doYourThing" is the function you want to invoke when that paricular link has recieved focus.
is not exactly like that, more like:
<a href="" onfocus="some_function">link1</a>
the only problem with this is that onfocus occurs when onclick(when you click) occurs, you usualy use onfocus when you are using <input type=text> or something similar
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 348
Reputation: Troy III will become famous soon enough Troy III will become famous soon enough 
Solved Threads: 42
Troy III's Avatar
Troy III Troy III is offline Offline
Posting Whiz
 
0
  #6
26 Days Ago
Originally Posted by futingkiller View Post
is not exactly like that, more like:
<a href="" onfocus="some_function">link1</a>
the only problem with this is that onfocus occurs when onclick(when you click) occurs, you usualy use onfocus when you are using <input type=text> or something similar
No..., its exactly like that.
Inline scripts are, 'a bad coding practice' everybody agrees upon. Me to.
The onfocus event gets fired when element receives focus. That's all you need to know. And there are many ways to send focus to element. You can even do it by script.
ie
someLink.focus() will suffice.

Link focus is implemented for accessibility reasons and especially for keyboard navigation ability.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 1,109
Reputation: cguan_77 has a little shameless behaviour in the past 
Solved Threads: 91
cguan_77's Avatar
cguan_77 cguan_77 is offline Offline
Veteran Poster
 
0
  #7
21 Days Ago
thank you all for your ideas..
Last edited by cguan_77; 21 Days Ago at 9:47 am.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC